Skip to content

Latest commit

 

History

History
89 lines (52 loc) · 1.49 KB

README.md

File metadata and controls

89 lines (52 loc) · 1.49 KB

Levenshtein

Levenshtein string difference in Javascript.

Screenshot

Levenshtein also does some neat things like coerce to a number and string appropriately. So you can compare Levenshtein objects directly! Not to mention it has specs!

API

  • new Levenshtein( m, n )Levenshtein

    • m ( String ): First string.
    • n ( String ): Second string.
    • Initialise a new Levenshtein object.
  • Levenshtein#distanceNumber

    • Distance between strings.
  • Levenshtein#inspect()String

    • Pretty print Levenshtein table.
  • Levenshtein#toString()String

    • Alias of: Levenshtein#inspect().
  • Levenshtein#valueOf()Number

    • Alias of: Levenshtein#distance.

Installation

Levenshtein works in both the browser and node.js.

Browser

Simply include levenshtein.js:

<script src="/javascripts/levenshtein.js"></script>

NPM

Install via npm:

npm install levenshtein

Or put it in your package.json:

{ "levenshtein": "~1.0" }

Bower

bower install levenshtein

Git

git clone git://github.com/gf3/Levenshtein.git

License

Levenshtein is UNLICENSED.

Author

Written by Gianni Chiappettaheavycorp.io