3 ms·
> 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 in
by skissane 5y ago
> 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
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.