retext-porter-stemmer
See Browser Support for more information (a.k.a. don’t worry about those grey icons above).
retext implementation of the Porter stemming algorithm.
Installation
NPM:
$ npm install retext-porter-stemmer
Component.js:
$ component install wooorm/retext-porter-stemmer
Usage
var Retext = require('retext'),
visit = require('retext-visit'),
stemmer = require('retext-porter-stemmer');
var root = new Retext()
.use(visit)
.use(stemmer)
.parse('A simple english sentence.');
root.visitType(root.WORD_NODE, function (node) {
console.log(node.toString(), node.data.stem);
});
This example also uses retext-visit.
API
None, the plugin automatically stems each word when its created or changed, and stores the stem in wordNode.data.stem
.
Browser Support
Pretty much every browser (available through browserstack) runs all retext-porter-stemmer unit tests.
License
MIT