SeqDiff - Diff between two sequences for Rust and Python
Functions to get correspondence between two sequences like diff
, based on Myers' algorithm.
Usage
Python
diff
...
Returns the correspondence between two sequences a
and b
.
key
is a comparison function (if needed).
=
=
, =
assert
assert
[0, None, 1]
[0, 2, None]
print_diff
...
Pretty print the diff between two sequences a
and b
.
key
is a comparison function (if needed).
=
=
, =
The return value is a pair of tuples. The first tuple contains the index where the item from the first sequence appears in the 2nd sequence or None
if the item doesn't appear in the 2nd sequence. The 2nd tuple is the same but listing the corresponding indexes for the 2nd sequence in the first sequence.
Rust
use seqdiff;
let = diff;
assert_eq!;
assert_eq!;
See the doc for more info.
Related
- tokenizations - Robust and Fast tokenizations alignment library for Rust and Python
- This library depends on
seqdiff
- This library depends on