Analyze text for word count, readability, reading time, and more. Reads files or stdin.
7w4.net小蔥技能站,你的AI助手技能庫。
# Analyze a file
python3 scripts/text_stats.py README.md
# Multiple files
python3 scripts/text_stats.py file1.txt file2.txt
# From stdin
echo "The quick brown fox jumps over the lazy dog." | python3 scripts/text_stats.py
# JSON output
python3 scripts/text_stats.py essay.md -f json
# Compact (key metrics only)
python3 scripts/text_stats.py chapter.txt --compact
| Metric | Description |
|---|---|
| Words | Total word count |
| Characters | Total characters (with and without spaces) |
| Lines | Total and non-blank line count |
| Sentences / Paragraphs | Count of each |
| Syllables | Estimated syllable count |
| Unique Words | Vocabulary diversity |
| Avg Word/Sentence Length | Average sizes |
| Reading Time | Estimated at 238 WPM |
| Speaking Time | Estimated at 150 WPM |
| Flesch Reading Ease | 0-100 scale (higher = easier) |
| Flesch-Kincaid Grade | US grade level equivalent |
| Difficulty | Easy / Standard / Fairly Difficult / Difficult / Very Difficult |
| Flag | Description |
|---|---|
-f, --format |
plain or json output |
--compact |
Show only words, sentences, reading time, grade, difficulty |
這是一款相當實用的文本分析工具,能快速給出詞彙量、句子數、閱讀時間等關鍵指標,還能評估文本難度和可讀性。無需安裝額外依賴是明顯的優勢,開啟就能用。不過它對英文文本的支援最好,中文或其他語言的分析效果可能打折扣。對於需要了解文章長度和閱讀難度的使用者來說,這個工具值得一試。質量整體不錯,功能實用,文件清晰。