Is there a lemmatizer for PHP?

Does anyone know about lemmatizer in PHP? Or, in the worst case, somehow use a lemmatizer in another language (e.g. python NLTK?) In a PHP webapp?

I am creating a macroemological analyzer , and I came across this problem when the etymological database does not contain any conjugated words. The lemmatizer will correct this, I think, by giving me the word “say” when the dictionary cannot find “said” and return “good” when the dictionary cannot find “better”, etc.

Note: the stemmer will not do the same as the lemmatizer.

+6
source share
4 answers

Does it help?

http://tartarus.org/~martin/PorterStemmer/php.txt

This is a PHP5 implementation of the Porter Stemmer algorithm.

0
source
0
source

Not https://github.com/heromantor/phpmorphy - is this what you are looking for?

0
source

Lemmatization is relatively complicated compared to what is happening, therefore it is more difficult to find some ready-made and free solution.

I see no one answered an additional question.

use lemmatizer somehow in another language (e.g. python NLTK?) in PHP webapp

php has at least exec and makes the same calls. You can simply run any external script or application.

there are some “lemmatizers” in php that can be found on the Internet, but with a quick check they turn into “stem” ones.

Make sure Stemming doesn't do it for you. Make sure that the solution that you already have in mind in another language is Lemmatizer.

I suspect that all solutions close to this name will be in C-type languages. In case they are Open Source or presented as libs, you can create them in PHP as an extension.

0
source

Source: https://habr.com/ru/post/954096/


All Articles