Calculate the similarity between strings