Closed Anaphase closed 7 years ago
What's odd is that the syllables are correctly counted individually, but when all the words are combined together, the incorrect total is returned.
text_stats.syllableCount('This') === 1
text_stats.syllableCount('sentence') === 2
text_stats.syllableCount('has') === 1
text_stats.syllableCount('eight') === 1
text_stats.syllableCount('syllables') === 3
text_stats.syllableCount('This sentence has eight syllables') === 9 // should be 8...
Hrm. This shouldn't be happening! strokes beard
I'll take a look. :)
If it helps, I boiled it down to this:
text_stats.syllableCount('This') === 1
text_stats.syllableCount('This sentence') === 3
text_stats.syllableCount('This sentence has') === 5 // should be 4...
It looks like its counting the syllables of whitespace. This would really skew down the readability scores. :-/
Well, I thought that too, but it doesn't seem consistent. "This has it"
correctly returns 3 syllables
¯_(ツ)_/¯
OK! I'll go spelunking. :)
Any updates on this? I'm thinking of using this module but since it skews the grade level right now, I'd rather not.
var stats = textstatistics("monkey goes yay");
stats.wordCount();
4
-_-
Fixed in #13. Sorry for neglecting this issue for so long!
Given the sentence:
syllableCount() will return 9. As verified on https://readability-score.com, DaveChild/Text-Statistics returns the correct syllable count of 8.