https://github.com/writecrow/lemmatizer
A PHP library for getting a lemma from a given word, and getting a list of words that map to a lemma.
https://github.com/writecrow/lemmatizer
lemma lemmatization lemmatizer natural-language-processing php-library
Last synced: 2 months ago
JSON representation
A PHP library for getting a lemma from a given word, and getting a list of words that map to a lemma.
- Host: GitHub
- URL: https://github.com/writecrow/lemmatizer
- Owner: writecrow
- License: mit
- Created: 2018-04-17T23:11:07.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-08T03:50:18.000Z (over 5 years ago)
- Last Synced: 2025-04-10T19:24:44.108Z (2 months ago)
- Topics: lemma, lemmatization, lemmatizer, natural-language-processing, php-library
- Language: PHP
- Homepage: https://lemmatizer.markfullmer.com/
- Size: 1.24 MB
- Stars: 12
- Watchers: 6
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lemmatizer
[](https://circleci.com/gh/writecrow/lemmatizer)
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](https://wordnet.princeton.edu/), 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
```php
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```