I'm interested in finding a text distance (or string similarity) algorithm which computes a greater distance (or lower similarity) when characters are further apart.
For example, I want the distance between abc
and abz
to be greater than the distance between abc
and abd
.
It would be easy to compute a text distance like this for strings of the same length, but I'd like to find one that also works for strings of different lengths.
Common algorithms like Levenshtein, Jaro-Winkler, and Ratcliff-Obershelp compute the same values for these two examples.
Edit: People are asking for a specific distance metric, so let's say it's the absolute difference between character values divided by the length of the longer string. And to keep this simple, only ASCII characters are considered.