Wink-lemmatizer
source link: https://www.tuicool.com/articles/hit/AvauQr6
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Introduction
wink-lemmatizer
English lemmatizer
Obtain base form or lemma of a word using wink-lemmatizer
. It is a part ofwink — a growing family of high quality packages for Statistical Analysis, Natural Language Processing and Machine Learning in NodeJS.
Installation
Use npm to install:
npm install wink-lemmatizer --save
Getting Started
// Load wink-lemmatizer var lemmatize = require( 'wink-lemmatizer' ); // Lemmatize adjectives lemmatize.adjective( 'farthest' ); // -> 'far' lemmatize.adjective( 'coolest' ); // -> 'cool' lemmatize.adjective( 'easier' ); // -> 'easy' // Lemmatize nouns lemmatize.noun( 'knives' ); // -> 'knife' lemmatize.noun( 'potatoes' ); // -> 'potato' lemmatize.noun( 'men' ); // -> 'man' // Lemmatize verbs lemmatize.verb( 'eaten' ); // -> 'eat' lemmatize.verb( 'pushes' ); // -> 'push' lemmatize.verb( 'suggesting' ); // -> 'suggest'
Documentation
Check out the lemmatizer API documentation to learn more.
Need Help?
If you spot a bug and the same has not yet been reported, raise a new issue or consider fixing it and sending a pull request.
Copyright & License
wink-lemmatizeris copyright 2017-18 GRAYPE Systems Private Limited .
It is licensed under the under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3 of the License.
adjective
Conjugates an adjective
to it's base form (VB). It also has an alias lemmatizeAdjective
to maintain API level compatibility with previous version.
adjective(adjective: string ): string
Parameters
(string)
— that needs to be conjugated to base form.
Returns
string
: the base form of
adjective
.
Example
lemmatize.adjective( 'farthest' ); // -> far
verb
Conjugates a verb
to it's base form (VB). It also has an alias lemmatizeVerb
to maintain API level compatibility with previous version.
Parameters
(string)
— that needs to be conjugated to base form.
Returns
string
: the base form of
verb
.
Example
lemmatize.verb( 'winning' ); // -> win
noun
Converts the input noun
to it's singular form. It also has an alias lemmatizeNoun
to maintain API level compatibility with previous version.
Parameters
(string)
— that needs to be lemmatized.
Returns
string
: the singular of
noun
.
Example
lemmatize.noun( 'handkerchieves' ); // -> handkerchief
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK