by TacticalCoder · 5y ago · 0 comments
Pretty sure the modification was relatively simply and the algo was still a dynamic programming algo. I probably still have the code somewhere.
EDIT: memory being fuzzy too but as I remember it the Levenshtein edit distance ain't that great for typos for a typo where you invert two characters counts as 2 instead of 1? It's probably overused for it's DP implementation is beautiful...
In which case you want Damerau–Levenshtein distance instead of Levenshtein distance. Damerau–Levenshtein distance counts swapping adjacent characters as a single editing operation instead of two consecutive operations.