anjlab/rubyfish — pull request #2 by brockspratlen (2013-08-13 04:31:08+00:00)
Title: Fix bug in DamerauLevenshtein transposition logic

It appears that there was an error when the pseudocode at the referenced Wikipedia page was translated given Ruby's zero-based string indexing; we're supposed to start checking for transpositions once we're in the second iteration of the loop, but the original port starting checking in the third iteration. This caused incorrect distances to be reported for strings that had transpositions for their first two characters.