0.1.3 • Published 6 years ago

string-matchingngramcount v0.1.3

Weekly downloads
16
License
MIT
Repository
github
Last release
6 years ago

string-matchingngramcount

NOTE: string-matchingngramcount was renamed to @extra-string/matching-ngram-count. NPM

Count matching n-grams between strings.

const matchingNgramCount = require('string-matchingngramcount');
// matchingNgramCount(<string-1>, <string-2>, <n>)

matchingNgrams('worm', 'storm', 2);
// 2 ('or', 'rm')
matchingNgrams('astronaut', 'astronomer', 3);
// 4 ('ast', 'str', 'tro', 'ron')
matchingNgrams('coconut', 'cotton', 2);
// 2 ('co', 'on')