JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 14226560
  • Score
    100M100P100Q329993F
  • License BSD-2-Clause

Damerau - Levenshtein distance by The Spanish Inquisition + relative distance

Package Exports

  • damerau-levenshtein

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (damerau-levenshtein) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.