1.0.0 • Published 9 years ago

retext-lancaster-stemmer v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

retext-lancaster-stemmer Build Status Coverage Status

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 = require('retext');
var inspect = require('unist-util-inspect');
var stemmer = require('retext-lancaster-stemmer');

retext().use(stemmer).use(function () {
    return function (cst) {
        console.log(inspect(cst));
    };
}).process('A simple English sentence.');

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

License

MIT © Titus Wormer

1.0.0

9 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago