0.1.3 • Published 5 months ago

ngramjs v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Ngram.js

String ngram splitter.

This is a light weight open source package for the server and browser (using module bundler) written with TypeScript. The source code is available on GitHub where you can also find our issue tracker.

Installation

Run the command below to install the package.

npm install --save ngramjs

Example

The code below shows a basic usage example.

import { tokenize, ngram } from 'ngramjs';

tokenize("I like opensource!"); // => ["I", "like", "opensource"]

ngram('opensource', { style: 1, min: 3, max: 5 }); // => ['ope', 'open', 'opens']
ngram('opensource', { style: 2, min: 3, max: 5 }); // => ['ope', 'open', 'opens', 'pen', 'pens', 'penso', 'ens', 'enso', 'ensou']

Forked from ngramablejs

0.1.3

5 months ago

0.1.2

5 months ago

0.1.1

5 months ago

0.1.0

5 months ago