Let's say I have two strings, is there any way to check if they are at least 90% similar?
var string1 = "theBoardmeetstoday,tomorrow51";
var string2 = "Board meets today, tomorrow";
Thanks,
Tegan
Let's say I have two strings, is there any way to check if they are at least 90% similar?
var string1 = "theBoardmeetstoday,tomorrow51";
var string2 = "Board meets today, tomorrow";
Thanks,
Tegan
jsdifflib is a JavaScript port of Python's excellent difflib library.
It has a function ratio()
which "return[s] a measure of the sequences’ similarity as a float in the range [0, 1]."
The wikipedia entry for Levenshtein distance includes a sample implementation.