https://github.com/arran4/sentencestats
Tools to plot character usage in sentences
https://github.com/arran4/sentencestats
amusement character-counter chart cli for-fun go golang joke meme plotter
Last synced: 3 months ago
JSON representation
Tools to plot character usage in sentences
- Host: GitHub
- URL: https://github.com/arran4/sentencestats
- Owner: arran4
- Created: 2021-08-24T07:24:51.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2026-02-14T12:28:40.000Z (4 months ago)
- Last Synced: 2026-02-14T21:18:58.346Z (4 months ago)
- Topics: amusement, character-counter, chart, cli, for-fun, go, golang, joke, meme, plotter
- Language: Go
- Homepage:
- Size: 77.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sentence Stats
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.
## Features
- **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 '.').
## Installation
Ensure you have Go installed (version 1.25+).
```bash
go install github.com/arran4/sentencestats/cmd/sentencestats@latest
```
## Usage
The tools read from standard input and output a PNG file.
### Character Frequency
```bash
echo "This is an example. This is also a test. This is also a demo." | sentencestats characters -o characters-example.png
```
Output:

### Character Pair Frequency
```bash
echo "This is an example. This is also a test. This is also a demo." | sentencestats character-pairs -o character-pairs-example.png
```
Output:

## Development
To run the tools from source:
```bash
go run ./cmd/sentencestats/ characters -o out.png < input.txt
go run ./cmd/sentencestats/ character-pairs -o out.png < input.txt
```
To run tests:
```bash
go test ./...
```