Comparing strings with tolerance
问题 I'm looking for a way to compare a string with an array of strings. Doing an exact search is quite easy of course, but I want my program to tolerate spelling mistakes, missing parts of the string and so on. Is there some kind of framework which can perform such a search? I'm having something in mind that the search algorithm will return a few results order by the percentage of match or something like this. 回答1: You could use the Levenshtein Distance algorithm. "The Levenshtein distance