Calculates the similarity of two strings