wink-porter2-stemmer
Version:
Implementation of Porter Stemmer Algorithm V2 by Dr Martin F Porter
73 lines (42 loc) • 2.93 kB
Markdown
# wink-porter2-stemmer
Implementation of [Porter Stemmer Algorithm V2](https://snowballstem.org/algorithms/english/stemmer.html) by Dr Martin F Porter
### [](https://travis-ci.org/winkjs/wink-porter2-stemmer) [](https://coveralls.io/github/winkjs/wink-porter2-stemmer?branch=master) [](http://inch-ci.org/github/winkjs/wink-porter2-stemmer) [](https://david-dm.org/winkjs/wink-porter2-stemmer?type=dev) [](https://gitter.im/winkjs/Lobby)
<img align="right" src="https://decisively.github.io/wink-logos/logo-title.png" width="100px" >
[Stem](https://en.wikipedia.org/wiki/Stemming) an inflected word into its base form using **`wink-porter2-stemmer`**.
## Installation
Use [npm](https://www.npmjs.com/package/wink-porter2-stemmer) to install:
npm install wink-porter2-stemmer --save
## Example [](https://npm.runkit.com/wink-porter2-stemmer)
```javascript
// Load porter stemmer V2
var stem = require( 'wink-porter2-stemmer' );
console.log( stem( 'properly' ) );
// -> proper
console.log( stem( 'borrowed' ) );
// -> borrow
console.log( stem( 'stemming' ) );
// -> stem
```
## API
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
#### Table of Contents
- [stem](#stem)
- [Parameters](#parameters)
- [Examples](#examples)
### stem
Stems an inflected `word` using Porter2 stemming algorithm.
#### Parameters
- `word` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** — word to be stemmed.
#### Examples
```javascript
stem( 'consisting' );
// -> consist
```
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** — the stemmed word.
## Need Help?
If you spot a bug and the same has not yet been reported, raise a new [issue](https://github.com/winkjs/wink-porter2-stemmer/issues) or consider fixing it and sending a pull request.
### About wink
[Wink](http://winkjs.org/) is a family of open source packages for **Statistical Analysis**, **Natural Language Processing** and **Machine Learning** in NodeJS. The code is **thoroughly documented** for easy human comprehension and has a **test coverage of ~100%** for reliability to build production grade solutions.
## Copyright & License
**wink-porter2-stemmer** is copyright 2017-19 [GRAYPE Systems Private Limited](http://graype.in/).
It is licensed under the terms of the MIT License.