You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your convenient extension. It may be really useful in many cases. But it gives the wrong output for Jaro-Winkler score.
The problem is in Jaro part: you can't count transpositions correctly running only one loop. There are missing transpositions in a case when strings are offset, has different length etc. I was banging my head in denial of the second for loop too. And there is no way to avoid it, presumably.
Thanks for your convenient extension. It may be really useful in many cases. But it gives the wrong output for Jaro-Winkler score.
The problem is in Jaro part: you can't count transpositions correctly running only one loop. There are missing transpositions in a case when strings are offset, has different length etc. I was banging my head in denial of the second
for
loop too. And there is no way to avoid it, presumably.You may want to check this implementation: https://www.rosettacode.org/wiki/Jaro-Winkler_distance#Swift, however it looks like there is a problem in common prefix count.
Also you may want to look into these implementations, prefix similarity is treated correct there: https://www.geeksforgeeks.org/jaro-and-jaro-winkler-similarity/, but there aren't Swift example.
Comparison of my take on Jaro-Winkler score vs yours vs Rosetta Code's
The text was updated successfully, but these errors were encountered: