cgiffard / TextStatistics.js

Generate information about text including syllable counts and Flesch-Kincaid, Gunning-Fog, Coleman-Liau, SMOG and Automated Readability scores.
MIT License
191 stars 37 forks source link

fix word count #11

Closed izhan closed 7 years ago

izhan commented 9 years ago

Fixes incorrect word count.

The current implementation adds a period to the end of any text, which adds an extra word count to any phrase. Taking an example from https://github.com/cgiffard/TextStatistics.js/issues/4 for instance:

var stats = textstatistics("monkey goes yay");
stats.wordCount();
4
cgiffard commented 7 years ago

Fixed in #13. Thanks for submitting a PR — sorry I neglected it for so long! :(