views:

1230

answers:

2

I am looking for an automatic language identification tool written in php. The tool should receive as input a string, and output the name of the (natural) language the string is written in. A perl example is TextCat, ported to Java by Knallgrau New Media Solutions. Does anyone know of a PHP port? Or another similar PHP tool?

+1  A: 

Not in php, unfortunately. But maybe you'll give half-credit for Natural Language Processing in Python, which is by far the most extensive NLP resource I've come across, with a tutorial in Python built in. And Python is closer to plug-compatible with php than either perl or java.

le dorfier
Thanks. BTW, I think you sent a local link instead of an HTTP URL. If worst comes to worst, I will google for the python resource...
Yuval F
Fixed. Thanks :(
le dorfier
+5  A: 

You can use Pear package Text_LanguageDetect. It recognizes 52 natural languages using 3-gram frequencies.

link0ff
Thanks a lot Juri. It also detects Tagalog. Just what I needed.
Yuval F