npm.io
1.0.2 • Published 5 years ago

node-carry

Licence
MIT
Version
1.0.2
Deps
0
Size
9 kB
Vulns
0
Weekly
0

node-carry

Pure Javascript implementation of Galileo Carry algorithm based on http://www.otlet-institute.org/docs/Carry.pdf

Note : The implementation descibed in the PDF differs with the one from the official C++ implementation. Node-carry follows the C++ implementation rules which gives .

Installation

npm i node-carry

How to use

const NodeCarry = require('node-carry');
const nc = new NodeCarry();

nc.stem('action') // ac
nc.stem('acteur') // ac
nc.stem('actrices') // ac
nc.stem('Dleyton') // Dleyton

How to use with natural

const NodeCarry = require('node-carry');
const nc = new NodeCarry();
const Stemmer = require('natural/lib/natural/stemmers/stemmer_fr');

const CarryStemmer = new Stemmer();
CarryStemmer.stem = nc.stem;

CarryStemmer.tokenizeAndStem('Le petit cheval de manège'); // ['pet', 'cheval', 'manèg']

Keywords