Closed NickCondron closed 1 year ago
Thinking about it more, we should probably just use: https://github.com/ajmalsiddiqui/levenshtein-diff
Hmm, that one doesn’t look super great imo. For one, DistanceMatrix being Vec<Vec<>> is a poor choice for memory allocations and cache locality. I think cleaning up editops.rs is more ideal.
I'm going to reopen this because I think the changes are good for now. I still feel like Levenshtein distance should be the type of thing an external crate can do well, but I agree there's some drawbacks to the linked crate.
The previous version was needlessly complicated. Clever use of iterators makes the code much simpler.
I also removed the unused
LevMatchingBlock
struct.I wanted to work on refactoring the levenshtein functions, but I didn't understand the semantics of the indexes
first_start
andsecond_start
or if the code relies on a certain behavior when resolving ambiguous edits.