Skip to content

tversky distance

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

Get Tversky distance between strings.

const tverskyDistance = require('@extra-string/tversky-distance');
// tverskyDistance(<string-1>, <string-2>, [α=1], [β=1], [ngram=2])

tverskyDistance('pocket', 'pocket');
// 0
tverskyDistance('monster', 'rocket');
// 1
tverskyDistance('pikachu', 'raichu', 0.2, 0.4, 3);
// 0.6666666666666667

extra-string

Clone this wiki locally