README
spache-formula
Formula to detect the grade level of text according to the (revised) Spache readability formula.
See spache
for a list of words which count as “known”.
Install
This package is ESM only: Node 12+ is needed to use it and it must be import
ed
instead of require
d.
npm:
npm install spache-formula
Use
import {spacheFormula} from 'spache-formula'
spacheFormula({word: 30, sentence: 2, unfamiliarWord: 6}) // => 4.114
spacheFormula({word: 30, sentence: 2}) // => 2.474
spacheFormula() // => NaN
API
This package exports the following identifiers: spacheFormula
.
There is no default export.
spacheFormula(counts)
Given the number of words (word
), the number of sentences (sentence
), and
the number of unique unfamiliar words (unfamiliarWord
) in a document, returns
the grade level associated with the document.
Related
automated-readability
— Uses character count instead of error-prone syllable parsercoleman-liau
— Uses letter count instead of an error-prone syllable parserdale-chall-formula
— Uses a dictionary, suited for higher reading levelsflesch
— Uses syllable countflesch-kincaid
— Likeflesch
, returns U.S. grade levelsgunning-fog
— Uses syllable count, needs POS-tagging and NERsmog-formula
— Likegunning-fog
, without the need for advanced NLP tasks