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

DamerauLevenshtein() vs Levenshtein() why the same distance ? #32

Closed
programistawpf opened this issue Sep 10, 2020 · 1 comment
Closed

Comments

@programistawpf
Copy link

135/5000
I expected a shorter distance for Damerau Levenshtein because there is an exchange of two letters. Why are there the same results?

julia> compare("martha", "martht", DamerauLevenshtein())
0.8333333333333334

julia> compare("martha", "martht", Levenshtein())
0.8333333333333334

@matthieugomez
Copy link
Owner

The distance (evaluate) is one in both cases. You would find the same thing in R.

Compare is 1 - distance /string length.

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