3 ms·
The Damerau-Levenshtein distance[1] also allows for the transposition of two adjacent characters and is more precise in my experience. That said, those string d
by KenanSulayman 8y ago
The Damerau-Levenshtein distance[1] also allows for the transposition of two adjacent characters and is more precise in my experience. That said, those string distance measures often have bad cases where seemingly similar string can result in a high number of "edits" to be estimated by Levensthein'ian algorithms.
In more advanced applications, there's also the Kendall tau distance [2], Jensen-Shannon divergence [3], overlap coefficient [4], Jaccard index [5], any many more, which may prove significantly more precise (depending on your use case).
[1] https://en.wikipedia.org/wiki/Damerau–Levenshtein_distance https://en.wikipedia.org/wiki/Damerau–Levenshtein_distance
[2] https://en.wikipedia.org/wiki/Kendall_tau_distance https://en.wikipedia.org/wiki/Kendall_tau_distance
[3] https://en.wikipedia.org/wiki/Jensen–Shannon_divergence https://en.wikipedia.org/wiki/Jensen–Shannon_divergence
[4] https://en.wikipedia.org/wiki/Overlap_coefficient https://en.wikipedia.org/wiki/Overlap_coefficient
[5] https://en.wikipedia.org/wiki/Jaccard_index https://en.wikipedia.org/wiki/Jaccard_index