time-to-botec/js/node_modules/@stdlib/nlp/porter-stemmer/README.md
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

1.8 KiB
Raw Permalink Blame History

porterStemmer

Extract the stem of a given word.

Usage

var porterStemmer = require( '@stdlib/nlp/porter-stemmer' );

porterStemmer( word )

Extracts the stem of a given word using the Porter stemming algorithm.

var out = porterStemmer( 'worldwide' );
// returns 'worldwid'

out = porterStemmer( 'fighting' );
// returns 'fight'

References

  • Porter, Michael F. 1980. "An algorithm for suffix stripping." Program 13 (3): 13037. doi:10.1108/eb046814.

Examples

var porterStemmer = require( '@stdlib/nlp/porter-stemmer' );

var out = porterStemmer( 'walking' );
// returns 'walk'

out = porterStemmer( 'walked' );
// returns 'walk'

out = porterStemmer( 'walks' );
// returns 'walk'

out = porterStemmer( '' );
// returns ''