Skip to content

jaccard index

Subhajit Sahu edited this page May 5, 2020 · 1 revision

Get Jaccard index between strings.

const jaccardIndex = require('@extra-string/jaccard-index');
// jaccardIndex(<string-1>, <string-2>, [ngram=2])

jaccardIndex('pocket', 'pocket');
// 1
jaccardIndex('monster', 'rocket');
// 0
jaccardIndex('pikachu', 'raichu', 3);
// 0.125

extra-string

Clone this wiki locally