Small CLI for counting sentences, words, syllables, and readability scores in English text.
- Sentence, word, syllable, and polysyllable counts
- Flesch-Kincaid Grade Level and Flesch Reading Ease
- SMOG Index and Gunning Fog Index
- CMU Pronouncing Dictionary lookup with hyphenation fallback
- Results logged to a table in
log/
python -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate
pip install -r requirements.txt
# Optional but recommended for better sentence boundary detection
python -m spacy download en_core_web_sm# One file
python main.py mytext.txt
# Multiple files
python main.py Text_Examples\sample1.txt Text_Examples\sample2.txt
# Whole directory (all .txt files)
python main.py --dir Text_ExamplesEach run writes a table to log/results_YYYYMMDD_HHMMSS.txt with columns:
Text Example, Sentences, Words, Polysyllables, Syllables,
Flesch Kincaid Level, Flesch Reading Ease, SMOG Index, Fog Index.
- If the spaCy model is not installed, the script falls back to a blank English pipeline with a sentencizer.
- Text examples live in
Text_Examples/.