writecrow / lemmatizer

A PHP library for getting a lemma from a given word, and getting a list of words that map to a lemma.

Home Page:https://lemmatizer.markfullmer.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lemmatizer

Circle CI

A PHP library for getting a lemma from a given word, and getting a list of words that map to a lemma. This does NOT support part of speech specification.

Source data

This lemma dictionary is largely based on WordNet, a project maintained at Princeton University.

Demo

See the lemmatizer in action at https://lemmatizer.markfullmer.com/

Usage in an application

The included index.php file contains an interactive demo.

Make your code aware of the Lemmatizer class via your favorite method (e.g., use writecrow\Lemmatizer\Lemmatizer;)

Then pass a word into one of the two methods

print Lemmatizer::getLemma('leaves');
// Will print 'leaf'

print Lemmatizer::getWordsFromLemma('leaf');
// Will print 'leaves,leafing,leafed,leafs'

Testing

Unit Tests can be run (after composer install) by executing vendor/bin/phpunit

About

A PHP library for getting a lemma from a given word, and getting a list of words that map to a lemma.

https://lemmatizer.markfullmer.com/

License:MIT License


Languages

Language:PHP 100.0%