README
coleman-liau
Formula to detect the ease of reading a text according to the Coleman-Liau index.
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 coleman-liau
Use
import {colemanLiau} from 'coleman-liau'
// For:
//
// Existing computer programs that measure readability are based largely upon
// subroutines which estimate number of syllables, usually by counting vowels.
// The shortcoming in estimating syllables is that it necessitates keypunching
// the prose into the computer.
// There is no need to estimate syllables since word length in letters is a
// better predictor of readability than word length in syllables.
// Therefore, a new readability formula was computed that has for its predictors
// letters per 100 words and sentences per 100 words.
// Both predictors can be counted by an optical scanning device, and thus the
// formula makes it economically feasible for an organization such as the U.S.
// Office of Education to calibrate the readability of all textbooks for the
// public school system.
//
// Containing 5 sentences, 119 words, and 639 letters or digits.
colemanLiau({sentence: 5, word: 119, letter: 639}) // => 14.53042…
API
This package exports the following identifiers: colemanLiau
.
There is no default export.
colemanLiau(counts)
Given an object containing the number of words (word
), the number of sentences
(sentence
), and the number of letters (letter
) in a document, returns the
grade level associated with the document.
Related
automated-readability
— Uses character count instead of error-prone syllable parserdale-chall-formula
— Uses a dictionary, suited for higher reading levelsflesch
— Uses syllable countflesch-kincaid
— Likeflesch-formula
, returns U.S. grade levelsgunning-fog
— Uses syllable count, hard to implement with a computer (needs POS-tagging and Named Entity Recognition)smog-formula
— Likegunning-fog-index
, without needing advanced NLPspache-formula
— Uses a dictionary, suited for lower reading levels