{"id":51133660,"url":"https://github.com/trananhtung/textstat","last_synced_at":"2026-06-27T17:00:29.573Z","repository":{"id":366610805,"uuid":"1275924675","full_name":"trananhtung/textstat","owner":"trananhtung","description":"Readability metrics for English text (Flesch, Flesch-Kincaid, Gunning Fog, SMOG, ARI, Coleman-Liau). Zero-dep, no_std.","archived":false,"fork":false,"pushed_at":"2026-06-22T14:47:57.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-22T16:17:00.400Z","etag":null,"topics":["flesch","nlp","no-std","readability","rust","text-processing","textstat"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trananhtung.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-21T10:12:07.000Z","updated_at":"2026-06-22T14:49:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/trananhtung/textstat","commit_stats":null,"previous_names":["trananhtung/textstat"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/trananhtung/textstat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trananhtung%2Ftextstat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trananhtung%2Ftextstat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trananhtung%2Ftextstat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trananhtung%2Ftextstat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trananhtung","download_url":"https://codeload.github.com/trananhtung/textstat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trananhtung%2Ftextstat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34780126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flesch","nlp","no-std","readability","rust","text-processing","textstat"],"created_at":"2026-06-25T15:01:44.208Z","updated_at":"2026-06-25T15:01:45.144Z","avatar_url":"https://github.com/trananhtung.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# textstat\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n\n[![Crates.io](https://img.shields.io/crates/v/textstat.svg)](https://crates.io/crates/textstat)\n[![Documentation](https://docs.rs/textstat/badge.svg)](https://docs.rs/textstat)\n[![CI](https://github.com/trananhtung/textstat/actions/workflows/ci.yml/badge.svg)](https://github.com/trananhtung/textstat/actions/workflows/ci.yml)\n[![License](https://img.shields.io/crates/l/textstat.svg)](#license)\n[![no_std](https://img.shields.io/badge/no__std-yes-brightgreen.svg)](#no_std)\n\n**Readability metrics for English text.** Flesch Reading Ease, Flesch-Kincaid\nGrade, Gunning Fog, SMOG, Automated Readability Index, Coleman-Liau — plus the\nword / sentence / syllable counts they're built on. Inspired by Python's\n[`textstat`](https://pypi.org/project/textstat/). Zero dependencies, `#![no_std]`.\n\n```rust\nlet text = \"The cat sat on the mat. The dog ran fast.\";\n\nassert_eq!(textstat::lexicon_count(text), 10);   // words\nassert_eq!(textstat::sentence_count(text), 2);\nassert_eq!(textstat::syllable_count(text), 10);\n\nlet ease = textstat::flesch_reading_ease(text);  // ~117 (very easy)\nlet grade = textstat::flesch_kincaid_grade(text); // ~ -1.8 (well below grade 1)\n```\n\n## Why textstat?\n\nRust's `readability` crates are *article extractors* (arc90/Mozilla Readability) —\nthey pull the main content out of a web page. **None of them compute readability\n*scores*.** `textstat` fills that gap: drop-in functions for the standard formulas,\nuseful for content tooling, SEO, writing assistants, education, and accessibility\n(WCAG) checks.\n\n## Install\n\n```toml\n[dependencies]\ntextstat = \"0.1\"\n```\n\n## Metrics\n\n| Function | Returns |\n| --- | --- |\n| `flesch_reading_ease` | 0–100+ score (higher = easier) |\n| `flesch_kincaid_grade` | U.S. school grade level |\n| `gunning_fog` | U.S. school grade level |\n| `smog_index` | U.S. school grade level |\n| `automated_readability_index` | U.S. school grade level |\n| `coleman_liau_index` | U.S. school grade level |\n| `reading_time(text, wpm)` | estimated seconds to read |\n\n### Counts\n\n`lexicon_count` (words), `sentence_count`, `syllable_count`, `syllables(word)`,\n`polysyllabic_count`, `char_count` (non-whitespace), `letter_count`.\n\n## Accuracy\n\nSyllables are estimated with a fast English heuristic (vowel groups + a silent-`e`\nrule, including accented Latin vowels), not a pronunciation dictionary, so scores\nare *close to* — not bit-identical with — dictionary-based tools. The metric\n**formulas** are the standard published ones.\n\n- `sentence_count` skips decimal points (`3.14`) and initialism dots (`U.S.A.`);\n  trailing abbreviation dots (`Dr.`) may still add one.\n- Best results are on English text. Non-Latin scripts (no Latin vowels) fall back\n  to one syllable per word, so scores stay bounded rather than correct.\n- Empty input yields `0` everywhere — no panics, no division by zero.\n\n## no_std\n\n`textstat` is `#![no_std]` (needs only `alloc`) with a dependency-free Newton's\n-method `sqrt`, so it builds for bare-metal targets such as `thumbv7em-none-eabi`.\n\n## Contributors ✨\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind are welcome — code, docs, bug reports, ideas, reviews! See the [emoji key](https://allcontributors.org/docs/en/emoji-key) for how each contribution is recognized, and open a PR or issue to get involved.\n\nThanks goes to these wonderful people:\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/trananhtung\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/30992229?v=4?s=100\" width=\"100px;\" alt=\"Tung Tran\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTung Tran\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/trananhtung/textstat/commits?author=trananhtung\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#maintenance-trananhtung\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n## License\n\nLicensed under either of [Apache-2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT) at\nyour option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrananhtung%2Ftextstat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrananhtung%2Ftextstat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrananhtung%2Ftextstat/lists"}