Skip to content

sorensen dice index

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

Get Sørensen-Dice index between strings.

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

sorensenDiceIndex('pocket', 'pocket');
// 1
sorensenDiceIndex('monster', 'rocket');
// 0
sorensenDiceIndex('pikachu', 'raichu', 3);
// 0.2222222222222222

extra-string

Clone this wiki locally