str-compare is a collection of algorithms to compare strings.
Installation
npm install str-compare
Algorithms
-
Hamming distance
-
Jaro-Winkler distance
-
Levenshtein distance
-
Sorensen / Dice coeficient
Basic usage
var strCompare = a = 'healed' b = 'healthy'; strCompare;>>> 0746031746031746 strCompare;>>> 08476190476190476 strCompare;>>> 3 strCompare;>>> 05714285714285714 s;>>> 05454545454545454
Contribution
Please feel free to contribute by forking this repo. Just be sure to add relevant unit tests and pass them all before submitting any code.
To setup the project, just install npm dependencies with npm install
and run
tests with npm test
.
License
MIT