Open mitsuhiko opened 3 years ago
I just dug into this a bit, so I thought I'd leave this here for future reference:
There are implementations by Neil Fraser here, likely with more up to date versions of the code:
https://github.com/google/diff-match-patch/
There's a port to Rust of the C++ implementation here:
https://github.com/dtolnay/dissimilar
So that looks like the best place to extract the algorithms and put them into Similar, like here:
https://github.com/dtolnay/dissimilar/blob/master/src/lib.rs#L506
For my particular use case, the dissimilar implementation actually appears to work quite well.
Related to #24 similar could benefit of having semantic cleanups for char level diffs.
https://neil.fraser.name/writing/diff/