calculate the similarity of two strings
