Skip to content

alexn2002/Text_Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text Analysis

Small CLI for counting sentences, words, syllables, and readability scores in English text.

Features

  • 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/

Setup

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

Usage

# 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_Examples

Each 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.

Notes

  • 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/.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages