Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

damerau-levenshtein

1.0.4 • Public • Published

NPM

I use algorithm kindly provided by TheSpanishInquisition here: http://jsperf.com/damerau-levenshtein-distance.

All credits goes there. I have only packed it into Node module.

It provides a function that takes two string arguments and returns a hash like this:

{
  steps: 5,       // Levenstein demerau distance
  relative: 0.7,  // steps / length of the longer string
  similarity: 0.3 // 1 - relative
}

Please see tests for more insights.

install

npm i damerau-levenshtein

Downloadsweekly downloads

3,320,775

version

1.0.4

license

BSD-2-Clause

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability