Formula to detect the ease of reading a text according to the Coleman-Liau index (1975)
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

readme.md

coleman-liau Build Status Coverage Status

Formula to detect the ease of reading a text according to the Coleman-Liau index.

Installation

npm:

npm install coleman-liau

Usage

var colemanLiau = require('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

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 parser
  • dale-chall-formula — Uses a dictionary, suited for higher reading levels
  • flesch — Uses syllable count
  • flesch-kincaid — Like flesch-formula, returns U.S. grade levels
  • gunning-fog — Uses syllable count, hard to implement with a computer (needs POS-tagging and Named Entity Recognition)
  • smog-formula — Like gunning-fog-index, without needing advanced NLP
  • spache-formula — Uses a dictionary, suited for lower reading levels

License

MIT © Titus Wormer