brentonashworth / clj-diff

Diff for Clojure Sequences
Eclipse Public License 1.0
114 stars 23 forks source link

levenshtein-distance was broken due to improper checking for empty collections in maz-or-zero #1

Closed vseloved closed 13 years ago

vseloved commented 13 years ago

Now all but one of the tests pass. I didn't dig deeper, what should be the correct answer in that failing one: 30 or 28...

brentonashworth commented 13 years ago

Thanks for the fix. For the failing test the correct answer is 28. This levenshtein distance function is not accurate. It tries to figure it out from the edit script but it is impossible to get the correct levenshtein distance from this information. There are many edit scripts with the same edit distance but with varying levenshtein distances. Once the diff functionality is complete I will revisit this and try to make a fast and accurate version.