Jaro Distance determines "closeness" of 2 strings
In Elixir, the String
module includes a function named jaro_distance
that
determines the similarity between two strings:
iex> String.jaro_distance("Chris", "Crhis")
0.9333333333333332
iex> String.jaro_distance("Chris", "Bob")
0.0
iex> String.jaro_distance("Chris", "Dennis")
0.5777777777777778
The docs say this works best with short strings. The Jaro distance article on wikipedia has lots of math if you're into that.
Tweet