Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 1.03 KB

README.md

File metadata and controls

30 lines (19 loc) · 1.03 KB

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']