plainscore 1.0.0
plainscore is a D library for readability scoring and wordy-phrase detection in English prose. It has no dependencies beyond Phobos and everything in it is @safe pure. It answers two questions about a passage. How heavy is it: six published formulae - Flesch reading ease, Flesch-Kincaid grade, Gunning fog, SMOG, Coleman-Liau and the automated readability index - computed from one shared tokenisation pass, so two scores for the same text can never disagree about how long that text was. And where is the weight: a detector that locates specific phrases with a shorter plain-English equivalent, reporting the position and the suggested replacement so a score can be acted on rather than only reported. The documentation is explicit about what these numbers are not. Every formula here is a function of sentence length and word length and nothing else, so none of them can tell a clear short sentence from a meaningless one of the same shape. A shipped unit test demonstrates the limit instead of only asserting it: on a contract-boilerplate excerpt against an API-reference excerpt, Flesch reading ease rates the legal text as the easier of the two while Gunning fog puts them the other way round. Disagreement between the formulae is itself the signal. Syllable counting is a heuristic - English orthography does not encode syllables - so the syllable module states its rules in its documentation and ships tests for cases it is known to get wrong, rather than presenting an estimate as a measurement. Coleman-Liau and ARI count letters instead and are unaffected. MIT licensed
| Tags | d library text readability linguistics |
|---|---|
| License | MITL |
| State | stable |