matching ngram count - nodef/extra-string GitHub Wiki

Count matching n-grams between strings.

const matchingNgramCount = require('@extra-string/matching-ngram-count');
// 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')

extra-string

⚠️ **GitHub.com Fallback** ⚠️