Calculate the similarity between strings or numbers