Skip to content
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

The value of "compare" is probably wrong. #49

Closed
C37H41N2O6 opened this issue Jul 9, 2021 · 1 comment
Closed

The value of "compare" is probably wrong. #49

C37H41N2O6 opened this issue Jul 9, 2021 · 1 comment

Comments

@C37H41N2O6
Copy link

C37H41N2O6 commented Jul 9, 2021

I understand that to normalize the Levenshtein distance, the value is divided by the longer string length.
However, the results I have calculated using that method are different from the results using the compare function.

julia> using StringDistances
julia> s1 = "martha"
julia> s2 = "marhtai"
julia> Levenshtein()(s1, s2)
3
julia> max(length(s1),length(s2))
7
julia> 1 - Levenshtein()(s1, s2) / 7
0.5714285714285714
julia> compare(s1, s2, Levenshtein())
0.8571428571428572

Why did this result occur?
I would appreciate it if you could tell me about it.

@matthieugomez
Copy link
Owner

You switched marhtai to mahrtai in your issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants