-
Notifications
You must be signed in to change notification settings - Fork 1
damerau levenshtein distance
Subhajit Sahu edited this page May 5, 2020
·
1 revision
Get Damerau-Levenshtein distance between strings.
const damerauLevenshteinDistance = require('@extra-string/damerau-levenshtein-distance');
// damerauLevenshteinDistance(<string-1>, <string-2>, [insertion cost=1], [deletion cost=1], [substitution cost=1], [transposition cost=1])
damerauLevenshteinDistance('gnu', 'gun');
// 1
damerauLevenshteinDistance('software', 'softwear');
// 2
damerauLevenshteinDistance('level field', 'lvele feidl', 1, 1, 1, 0.1);
// 0.4