Sentence Stats is a Go tool for visualizing character and character pair frequencies in sentences. It generates histogram plots to help analyze the composition of text.
- Character Frequency: Visualizes the frequency of each character in the input text.
- Character Pair Frequency: Visualizes the frequency of character pairs (bigrams), ignoring order (e.g., "ab" and "ba" are counted together).
- Sentence-based Analysis: Processes input sentence by sentence (split by '.').
Download binaries from: https://github.com/arran4/sentencestats/releases
brew tap arran4/homebrew-tap brew install sentencestats
go install github.com/arran4/sentencestats/cmd/sentencestats@latest
- Debian/Ubuntu (
.deb): see Releases assets - RPM (
.rpm): see Releases assets - Alpine (
.apk): see Releases assets - Arch (
.pkg.tar.zstor repo): see Releases assets
The tools read from standard input and output a PNG file.
echo "This is an example. This is also a test. This is also a demo." | sentencestats characters -o characters-example.pngOutput:
echo "This is an example. This is also a test. This is also a demo." | sentencestats character-pairs -o character-pairs-example.pngOutput:
To run the tools from source:
go run ./cmd/sentencestats/ characters -o out.png < input.txt
go run ./cmd/sentencestats/ character-pairs -o out.png < input.txtTo run tests:
go test ./...
