How similar are these two strings?
npm install similarity --save
The module exports a single function that compares two strings and returns a value between
1. The closer the value is to
1, the more similar the two string are:
var similarity =// 1// 0.75// 0// 0.714285714// 0.875// 0.875 (case insensitive)
Note: This module uses Levenshtein distance to measure similarity, but there are many other algorithms for string comparison. Here are a few:
- clj-fuzzy - A handy collection of algorithms dealing with fuzzy strings and phonetics.
- natural - general natural language facilities for node.
- string-similarity - Finds degree of similarity between two strings, based on Dice's Coefficient, which is mostly better than Levenshtein distance.
- jaro-winkler - The Jaro-Winkler distance metric for node and browser.
npm installnpm test
- leven: Measure the difference between two strings using the fastest JS implementation of the Levenshtein distance algorithm
- tap: A Test-Anything-Protocol library
Generated by package-json-to-readme