retext-lancaster-stemmer
retext implementation of the Lancaster (Paice/Husk) stemming algorithm.
Installation
npm:
npm install retext-lancaster-stemmer
retext-lancaster-stemmer is also available for bower, component, and duo, and as an AMD, CommonJS, and globals module, uncompressed and compressed.
Usage
var retext = ;var inspect = ;var stemmer = ; ;
Yields:
RootNode[1]└─ ParagraphNode[1] └─ SentenceNode[8] ├─ WordNode[1] [data={"stem":"a"}] │ └─ TextNode: 'A' ├─ WhiteSpaceNode: ' ' ├─ WordNode[1] [data={"stem":"simpl"}] │ └─ TextNode: 'simple' ├─ WhiteSpaceNode: ' ' ├─ WordNode[1] [data={"stem":"engl"}] │ └─ TextNode: 'English' ├─ WhiteSpaceNode: ' ' ├─ WordNode[1] [data={"stem":"sent"}] │ └─ TextNode: 'sentence' └─ PunctuationNode: '.'
API
None, retext-lancaster-stemmer automatically detects the stem of each
WordNode
(using
wooorm/lancaster-stemmer),
and stores the stem in node.data.stem
.
Related
- retext-porter-stemmer — Uses the Porter stemming algorithm.