New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ngram

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngram

ngrams for node.js

latest
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

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

  • libTextCat wich provides original stats files.
  • language_detector, a ruby tools with wikipedia's data.

Keywords

ngram

FAQs

Package last updated on 06 Dec 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts