wooorm / readability

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

Mean is NAN if DaleChall not familiar #6

Closed MichaelChambers closed 4 years ago

MichaelChambers commented 4 years ago

Since dale-chall-formula's gradeMap has 10: [16, Infinity] and readability has: daleChallFormula.gradeLevel(daleChallFormula(counts))[1] Then when Dale-Chall does not recognize the word, Mean tries to calculate including a value of infinity and so becomes NAN. Perhaps Dale-Chall should be counted as 17 in that case, instead of Infinity. It could either be changed in dale-chall-formula or in readability when doing math with the scores - I'm not sure which would be better.

wooorm commented 4 years ago

Fixed by implementing a max age (22)