csnlp
v0.0.3
Published
The clumsy NLP JS library!
Downloads
7
Readme
CSNLP - the clumsy NLP JS library!
CSNLP is a javascript library that provides common NLP features such as tokenization, stemming, computing distance and many others.
Usage
npm install csnlp
Require using node.js
var csnlp = require('csnlp')
API Docs
- Whitespace Tokenizer - Takes a string and tokenizes it by whitespace. Returns an array of strings.
var tokens = csnlp.tokenizeWS(string);
- Treebank Tokenizer - Takes a string and tokenizes it using the set of rules found here. Returns an array of strings.
var tokens = csnlp.tokenizeTB(string);
Minimum Edit Distance - Accepts two arrays or strings and measures the distance between the two. Returns an integer.
The getEditDistance uses Damerau-Levenshtein Minimum Edit Distance algorithm by counting the number of the four operations: insertion, deletion, substitution and transposition.
var distance = csnlp.getEditDistance(a, b);