Napolean Paced Mischeviously

    dale-chall-formula
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    dale-chall-formula

    Build Coverage Downloads Size

    Formula to detect the grade level of text according to the (revised) Dale–Chall readability formula.

    See dale-chall for a list of words which count as “familiar”.

    Install

    This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.

    npm:

    npm install dale-chall-formula

    Use

    import {daleChallFormula, daleChallGradeLevel} from 'dale-chall-formula'
    
    daleChallFormula({word: 30, sentence: 2, difficultWord: 6}) // => 4.41208
    
    daleChallFormula({word: 30, sentence: 2}) // => 0.744
    
    daleChallFormula() // => NaN
    
    daleChallGradeLevel(daleChallFormula(30, 2, 6)) // => [9, 10]

    API

    This package exports the following identifiers: daleChallFormula, daleChallGradeLevel. There is no default export.

    daleChallFormula(counts)

    Given the number of words (word), the number of sentences (sentence), and the number of unique unfamiliar words in a document (difficultWord), returns the score associated with the document.

    daleChallGradeLevel(score)

    Given a score, returns the corresponding grade ranges

    Score Corresponding Grade Level Return value
    Less than 5 Grade 4 and lower [0, 4]
    Less than 6 Grades 5 and 6 [5, 6]
    Less than 7 Grades 7 and 8 [7, 8]
    Less than 8 Grades 9 and 10 [9, 10]
    Less than 9 Grades 11 and 12 [11, 12]
    Less than 10 Grades 13 and 15 (College) [13, 15]
    Higher Grades 16 and higher (College Graduate) [16, Infinity]

    Related

    • automated-readability — Uses character count instead of error-prone syllable parser
    • coleman-liau — Uses letter count instead of an error-prone syllable parser
    • flesch — Uses syllable count
    • flesch-kincaid — Like flesch-formula, returns U.S. grade levels
    • gunning-fog — Uses syllable count, needs POS-tagging and NER
    • smog-formula — Like gunning-fog-index, without needing advanced NLP
    • spache-formula — Uses a dictionary, suited for lower reading levels

    License

    MIT © Titus Wormer

    Install

    npm i dale-chall-formula

    DownloadsWeekly Downloads

    1,028

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    9.26 kB

    Total Files

    5

    Last publish

    Collaborators

    • wooorm
    • zeke