#lcs #diff

lcs

A library for computing longest common subsequences and diffs

3 unstable releases

Uses old Rust 2015

0.2.0 Sep 25, 2015
0.1.1 Sep 22, 2015
0.1.0 Sep 22, 2015

#11 in #lcs

Download history 32/week @ 2024-12-16 2/week @ 2024-12-23 10/week @ 2024-12-30 21/week @ 2025-01-06 32/week @ 2025-01-13 28/week @ 2025-01-20 35/week @ 2025-01-27 82/week @ 2025-02-03 47/week @ 2025-02-10 46/week @ 2025-02-17 75/week @ 2025-02-24 61/week @ 2025-03-03 89/week @ 2025-03-10 69/week @ 2025-03-17 80/week @ 2025-03-24 28/week @ 2025-03-31

273 downloads per month
Used in 2 crates

MIT license

10KB
168 lines

This crate provides utilities around least common subsequences. From a least common subsequences table, you can also calculate diffs (see LcsTable::diff).

Usage of this crate is centered around LcsTable, so most interesting documentation can be found there.


lcs

A library for finding longest common substrings. You can also use this library to calculate a diff between two sequences.

Example

extern crate lcs;

let a: Vec<_> = "a--b---c".chars().collect();
let b: Vec<_> = "abc".chars().collect();

let table = lcs::LcsTable::new(&a, &b);
let lcs = table.longest_common_subsequence();

assert_eq!(vec![&'a', &'b', &'c'], lcs);

Documentation

crates.io

No runtime deps