0.2.1 • Published 3 months ago

@stdlib/nlp-porter-stemmer v0.2.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 months ago

porterStemmer

NPM version Build Status Coverage Status

Extract the stem of a given word.

Installation

npm install @stdlib/nlp-porter-stemmer

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'

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 ''

References

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

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2024. The Stdlib Authors.