GlobalNamesArchitecture / damerau-levenshtein

Calculates edit distance using Damerau-Levenshtein algorithm
MIT License
143 stars 19 forks source link

Does not handle case where one of the strings is one character long #2

Closed Muon closed 12 years ago

Muon commented 12 years ago
irb(main):018:0> DamerauLevenshtein.distance('a', 'ab')
=> 0
irb(main):019:0> DamerauLevenshtein.distance('a', 'a')
=> 0
irb(main):020:0> DamerauLevenshtein.distance('a', 'bc')
=> 0
irb(main):021:0> DamerauLevenshtein.distance('bc', 'a')
=> 0
irb(main):022:0> DamerauLevenshtein.distance('bct', 'a')
dimus commented 12 years ago

Created a bug branch https://github.com/GlobalNamesArchitecture/damerau-levenshtein/tree/bug_one_character for resolving this issue

dimus commented 12 years ago

Fixed, pushed gem 0.5.4 to rubygems.org