Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
text analysis with ngrams for nodejs
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib splitting and null != undefined
test nodeunit => vows
.gitignore
CHANGELOG.md
README.md paper for wrapping fishes.
package.json

README.md

Ngram for Node

Tokenization

var ngram = require('ngram');

var tokens = "Hello world".tokens();
console.log(tokens); // ['hello', 'world']

Language guessing

OpenOffice and its variants (LibreOffice, NeoOffice, OOo4Kids ...) provides libtextcat languages ngram stats files.

var ngram = require('ngram');

var fp = new ngram.FingerPrint();
fp.registerFolder('/Applications/LibreOffice.app/Contents/basis-link/share/fingerprint/');
var n = new ngram.Ngrams();
n.min = 3;
n.feedAll('redis ça si tu es un homme'.tokens()); // fr
n = new ngram.Ngrams();
n.min = 3;
n.feedAll('redis is a network tools'.tokens()); // en

Real World example

node twitter reader

More links

Something went wrong with that request. Please try again.