With Commons Lang api I can calculate the similarity between two strings through the LevensteinDistance. The result is the number of changes needed to change one string into ano
Just divide by some number. The question is what number? Probably the maximum possible distance for the given pair of strings. I think that's the length of the longer string (ie all the characters are different, plus a few more were added, compared with the shorter string).