Skip to content

sorensen dice distance

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

Get Sørensen-Dice distance between strings.

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

sorensenDiceDistance('pocket', 'pocket');
// 0
sorensenDiceDistance('monster', 'rocket');
// 1
sorensenDiceDistance('pikachu', 'raichu', 3);
// 0.7777777777777778

extra-string

Clone this wiki locally