Calculate the similarity between two strings