DaveChild / Text-Statistics

Generate information about text including syllable counts and Flesch-Kincaid, Gunning-Fog, Coleman-Liau, SMOG and Automated Readability scores.
https://readable.com/
BSD 2-Clause "Simplified" License
446 stars 107 forks source link

Can't create 2 instances #24

Closed cgutteridge closed 10 years ago

cgutteridge commented 10 years ago

If you create a second instance of the statistics module, the first one has already loaded all the words with include_once so the second instance doesn't get the words.

I suggest making a TextStatistics::instance() method which returns an instance, and stores it in a static variable in the class, so if you run it again you get the same object not a new one.

DaveChild commented 10 years ago

I believe this is fixed in the new version.