strsim-rs
strsim-rs copied to clipboard
Jaro Winkler transpositions handled incorrectly.
When comparing two strings that have a lot of transposed characters, the score comes out slightly wrong.
For example: the strings "a jke" and "jane a k" produce a result of 0.6833, which corresponds to 4 matches and 1 transposition. However there are actually 2 transpositions, because the number of out of sequence characters is 4: "a", " ", "j", "e" are all out of order (and transpositions = 4 / 2). The actual score comes out to be 0.6.