Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compute the Jaro similarity between two strings
ResourceFunction["JaroSimilarity"][s1,s2] computes the Jaro similarity between strings s1 and s2. |
Identical strings have a similarity of 1.0:
In[1]:= | ![]() |
Out[1]= | ![]() |
These two strings have no similarity:
In[2]:= | ![]() |
Out[2]= | ![]() |
These two strings have some similarity:
In[3]:= | ![]() |
Out[3]= | ![]() |
Similar strings with transpositions. There are 6 matching characters (all characters) and 2 transposed characters (T and H):
In[4]:= | ![]() |
Out[4]= | ![]() |
This matches the Jaro similarity formula:
In[5]:= | ![]() |
Out[5]= | ![]() |
Compute the Jaro similarity of two strings of unequal length:
In[6]:= | ![]() |
Out[6]= | ![]() |
There are four matching characters (D, A, N, E) and no transposed characters:
In[7]:= | ![]() |
Out[7]= | ![]() |
Generate 10 random words and compute the Jaro similarity between all of them:
In[8]:= | ![]() |
Out[8]= | ![]() |
In[9]:= | ![]() |
Out[9]= | ![]() |
Wolfram Language 14.0 (January 2024) or above
This work is licensed under a Creative Commons Attribution 4.0 International License