Levenshtein
Levenshtein string difference in Javascript.
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.
- m (
-
Levenshtein#distance
βNumber
- Distance between strings.
-
Levenshtein#inspect()
βString
- Pretty print Levenshtein table.
-
Levenshtein#toString()
βString
- Alias of:
Levenshtein#inspect()
.
- Alias of:
-
Levenshtein#valueOf()
βNumber
- Alias of:
Levenshtein#distance
.
- Alias of:
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 Chiappetta β heavycorp.io