Is there any open source text analysis library for PHP?

Marc picture Marc · Dec 12, 2009 · Viewed 7.4k times · Source

I am looking for a PHP library which does more or less the same thing as this webpage: http://textalyser.net/

I know that there are popular libraries in python and java, but I am looking for a PHP version. Thanks for your help!

Answer

Potherca picture Potherca · Dec 13, 2009

Short Answer

As far as I'm aware there's isn't one, or at least not a well-known / well-distributed one.

Long Answer

The closes de-facto code I've come across is php-text-statistics by Dave Child (since the PEAR version has been unmaintained for years) but that only takes care of readability and sentence, word and syllable counting. Any other data you'd have to get yourself with count_chars, str_word_count, substr_count, preg_match_all and the like. And of course some math skills to calculate all the percentages.

That said, I'm not sure exactly what is it you'd want the library to do, or what http://textalyser.net/ does...
(I mean what is a stoplist anyway? Or an exhaustive polyword phrase, for that matter...?)