-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug in DamerauLevenshtein
#30
Comments
Thanks. How did you end up on this? I am now restricting the last argument to be an Integer (26221a1). Does that solve your issue? |
So I ended up at this issue by trying to answer: "does short word julia> w = "abcdef"
"abcdef"
julia> str = "1234abcxyf1234"
"1234abcxyf1234"
julia> Partial(DL)(w, str, 2 / length(w))
1.0
Here, the answer I want is julia> Partial(DL)(w, str, (2 / length(w)) + eps())
0.3333333333333333
I thought things were working fine until I ran into a test query that did not match, which I reduced to the issue here. I think therefore restricting to integers will at least error instead of giving the wrong answer, but I'm not sure it solves the problem completely, since I don't quite know how to do get the right functionality. I think maybe I should just vendor a copy of |
Maybe I am using julia> DL("abcdef", "abcxyf", 2)
3
julia> DL("abcdef", "abcxyf",3)
2 I was thinking they both should be 2. |
Right, it's a bug. Thanks for spotting it. I think I have solved it with 4df4bad. |
Thanks for the quick fixes! I'll try again tomorrow and see if I can spot any issues. |
Also, Partial no longer normalizes by default. |
I haven't been able to find any more issues, by the way. I'll post a new issue if I find any. Mind registering the latest release? |
ok, done. Let me know if you encounter other bugs — this is very useful. |
Will do, thanks! |
Here,
DL(a, b, max_dist)
should be1
for anymax_dist > 1
. But it seems for1<max_dist<2
we get the wrong answer.The text was updated successfully, but these errors were encountered: