Skip to main content

word-to-root-stem

ai-research-agent / tokenize/word-to-root-stem

Topics

stemWordToRoot()

function stemWordToRoot(word): string

Stems a word using the Porter Stemmer for removing inflectional endings like "ing", "ist", "ize".

Parameters

ParameterTypeDescription

word

string

The word to be stemmed

Returns

string

  • The stemmed word

Author

Porter, M. (1980)

Example

var rootWord = stemWordToRoot("running"); // returns "run"