Weighted Damerau–Levenshtein distance
A simple Node module that allows you to compute Damerau–Levenshtein
with custom weights for insertion, deletion and/or substitution (they all
1). It is inspired by the
let dldist = ;const d = ;// 4 -> two substitutions and two insertionsconst s = ;// 3 -> two substitutions with weight 1 and two insertions with weight 0.5
It also optionally allows you to turn-off the "Damerau" part of the Damerau-Levenshtein distance (i..e the transpositions), which makes it the standard Levenshtein distance.
let dldist = ;const d = ;// 1 -> one transpostion (counted with the default subsitution weight)const s = ;// 2 -> one substitution and one deletion (both with default weight)
npm install weighted-damerau-levenshtein
Licensed under the terms of the Apache 2.0 license. See the LICENSE file for more details.