I need to compare 2 strings and calculate their similarity, to filter down a list of the most similar strings.
Eg. searching for "dog" would return
Eg. searching for "crack" would return
I have come across:
Do you know of any more string similarity algorithms?
The Levenshtein distance is the algorithm I would recommend. It calculates the minimum number of operations you must do to change 1 string into another. The fewer changes means the strings are more similar...