wooorm / readability

visualise readability
https://wooorm.com/readability/
MIT License
205 stars 19 forks source link

It looks like you mixed up Dale-Chall and Spache #3

Closed davidawad closed 5 years ago

davidawad commented 5 years ago

So I think you mixed up the measures for easy words and familiar words in index.js around line 380.

From https://github.com/wooorm/readability/blob/src/src/index.js#L383-L398 :

    // Find unique unfamiliar words for spache.
    if (
      spache.indexOf(normalized) !== -1 &&
      familiarWords[normalized] !== true
    ) {
      familiarWords[normalized] = true
      familiarWordCount++
    }

    // Find unique difficult words for dale-chall.
    if (daleChall.indexOf(normalized) !== -1 && easyWord[normalized] !== true) {
      easyWord[normalized] = true
      easyWordCount++
    }
  }
}

The docs for Dale-chall describe it as "List of familiar American-English words: The New Dale-Chall (1995)."

The docs for Spache describe it as a "List of easy American-English words: Revised Spache (1974)."

So I think you just have to switch the counts.

wooorm commented 5 years ago

Checking the formula’s (spache, dale-chall), the correct counts are used (familiar/unfamiliar, easy/difficult). So I’d say the descriptions of the lists need to be fixed.

wooorm commented 5 years ago

Fixed in the word list packages!