Skip to content

jaccard distance

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

Get Jaccard distance between strings.

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

jaccardDistance('pocket', 'pocket');
// 0
jaccardDistance('monster', 'rocket');
// 1
jaccardDistance('pikachu', 'raichu', 3);
// 0.875

extra-string

Clone this wiki locally