strsim-rs icon indicating copy to clipboard operation
strsim-rs copied to clipboard

Jaro Winkler transpositions handled incorrectly.

Open jacwellington opened this issue 4 years ago • 0 comments

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.

jacwellington avatar Nov 09 '21 21:11 jacwellington