Weighted Damerau–Levenshtein distance
![NPM](https://img.shields.io/npm/l/weighted-damerau-levenshtein)
A simple Node module that allows you to compute Damerau–Levenshtein
distance
with custom weights for insertion, deletion and/or substitution (they all
default to 1
). It is inspired by the
damerau-levenshtein
and
damerau-levenshtein-js
packages.
let dldist = require('weighted-damerau-levenshtein');
const d = dldist('hello word', 'Hello World!');
const s = dldist('hello word', 'Hello World!', { insWeight: 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 = require('weighted-damerau-levenshtein');
const d = dldist('Hi there', 'Hi tehre');
const s = dldist('Hi there', 'Hi tehre', { useDamerau: false });
Install
npm install weighted-damerau-levenshtein
License
Licensed under the terms of the Apache 2.0 license. See the
LICENSE file for more details.