lemmatizerx 0.0.3 copy "lemmatizerx: ^0.0.3" to clipboard
lemmatizerx: ^0.0.3 copied to clipboard

Lemmatizer for text in English. Inspired by Python's nltk.corpus.reader.wordnet.morphy

example/example.md

import  'package:lemmatizerx/lemmatizerx.dart';

Lemmatizer lemmatizer = Lemmatizer();

//
// Lookup single lemma
//

Lemma lemma = lemmatizer.lemma('books', POS.NOUN);
print(lemma.pos); // POS.NOUN
print(lemma.form); // books
print(lemma.lemmas); // [book]
print(lemma); // POS.NOUN books [book]

lemma = lemmatizer.lemma('loveliest', POS.ADJ);
print(lemma.pos); // POS.ADJ
print(lemma.form); // loveliest
print(lemma.lemmas); // [lovely]
print(lemma); // POS.ADJ loveliest [lovely]

//
// Lookup single lemma and fail
//

lemma = lemmatizer.lemma('wordDoesNotExist', POS.NOUN);
print(lemma.lemmasFound); // false
print(lemma.lemmasNotFound); // true

//
// Lookup multiple lemmas
//

List<Lemma> lemmas = lemmatizer.lemmas('meeting');

print(lemmas); // [POS.NOUN meeting [meeting], POS.VERB meeting [meet]]

Lemma noun = lemmas.firstWhere((lemma) => lemma.pos == POS.NOUN);
Lemma verb = lemmas.firstWhere((lemma) => lemma.pos == POS.VERB);

print(noun.lemmas); // [meeting]
print(verb.lemmas); // [meet]
5
likes
140
pub points
66%
popularity

Publisher

verified publishernovelplotter.com

Lemmatizer for text in English. Inspired by Python's nltk.corpus.reader.wordnet.morphy

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on lemmatizerx