Skip to content

Conversation

@NickCondron
Copy link
Contributor

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 and second_start or if the code relies on a certain behavior when resolving ambiguous edits.

@NickCondron
Copy link
Contributor Author

Thinking about it more, we should probably just use: https://github.com/ajmalsiddiqui/levenshtein-diff

@encounter
Copy link
Owner

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.

@NickCondron
Copy link
Contributor Author

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.

@NickCondron NickCondron reopened this Jan 17, 2023
@encounter encounter merged commit 3406c76 into encounter:main Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants