@haggholm/damerau-levenshtein
TypeScript icon, indicating that this package has built-in type declarations

1.0.14 • Public • Published

Damerau-Levenshtein distance

A direct port of the Levenshtein/Damerau-Levenshtein algorithm from natural to an N-API/C++ extension.

In the browser, it will use the implementation copied from natural, with the addition of an offset parameter in search results.

In NodeJS, it uses the N-API implementation. In tests on production data on our workload, it is ~15x faster than the original JS; on smaller strings as used in the automated tests, the speedup is ~27x.

Correctness is based on the assumption that natural is correct. :-) Compliance is currently verified by running distance checks on several thousand random sample strings and verifying that the N-API generates identical results.

/@haggholm/damerau-levenshtein/

    Package Sidebar

    Install

    npm i @haggholm/damerau-levenshtein

    Weekly Downloads

    12

    Version

    1.0.14

    License

    MIT

    Unpacked Size

    1.75 MB

    Total Files

    28

    Last publish

    Collaborators

    • haggholm