In computer science and statistics, the Jaro–Winkler similarity is a string metric measuring an edit distance between two sequences. It is a variant of the Jaro distance metric (1989, Matthew A. Jaro) proposed in 1990 by William E. Winkler. The Jaro–Winkler distance uses a prefix scale p {\displaystyle p} which gives more favourable ratings to strings that match from the beginning for a set prefix length ℓ {\displaystyle \ell } . The higher the Jaro–Winkler distance for two strings is, the less similar the strings are. The score is normalized such that 0 means an exact match and 1 means there is no similarity. The original paper actually defined the metric in terms of similarity, so the distance is defined as the inversion of that value (distance = 1 − similarity). Although often referred to as a distance metric, the Jaro–Winkler distance is not a metric in the mathematical sense of that term because it does not obey the triangle inequality.
Definition
Jaro similarity The Jaro similarity sim j {\displaystyle {\text{sim}}_{j}} of two given strings s 1 {\displaystyle s_{1}} and s 2 {\displaystyle s_{2}} is
sim j = { 0 if m = 0 1 3 ( m | s 1 | + m | s 2 | + m − t m ) otherwise {\displaystyle {\text{sim}}_{j}=\left\{{\begin{array}{l l}0&{\text{if }}m=0\\{\frac {1}{3}}\left({\frac {m}{|s_{1}|}}+{\frac {m}{|s_{2}|}}+{\frac {m-t}{m}}\right)&{\text{otherwise}}\end{array}}\right.}
Where:
| s i | {\displaystyle |s_{i}|} is the length of the string s i {\displaystyle s_{i}} ;
m {\displaystyle m} is the number of matching characters (see below);
… excerpt ends here. Continue reading the full article.
