Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stagerightlabs/freq
Perform frequency analysis on text
https://github.com/stagerightlabs/freq
golang
Last synced: 1 day ago
JSON representation
Perform frequency analysis on text
- Host: GitHub
- URL: https://github.com/stagerightlabs/freq
- Owner: stagerightlabs
- Created: 2020-11-12T20:22:43.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-17T18:51:07.000Z (about 4 years ago)
- Last Synced: 2024-03-25T01:55:16.930Z (10 months ago)
- Topics: golang
- Language: Go
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Freq - Frequency Analysis API
Perform frequency analysis on the letters in a piece of text. Works in the console or via API.
## Command Line Usage
First compile the binary:
```
$ go build
```You can provide the text to be analyzed as an argument to the command:
```
$ ./freq --text "You have power over your mind - not outside events. Realize this, and you will find strength. - Marcus Aurelius"
```Alternatively, you can specify a file to be analyzed:
```
$ ./freq --file _data/marcus.txt
```## API Usage
First compile the binary:
```
$ go build
```Launch the server:
```
$ ./freq --serve --host 0.0.0.0 --port 8080
```If not otherwise specified, the default host will be `0.0.0.0` and the default port will be `80`.
You can test the API response with curl:
```
$ curl -X POST -id "text=You have power over your mind - not outside events. Realize this, and you will find strength. - Marcus Aurelius" localhost:8080/freq
```