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

#4 in #longest

Download history 94/week @ 2025-04-13 151/week @ 2025-04-20 200/week @ 2025-04-27 258/week @ 2025-05-04 15/week @ 2025-05-11 67/week @ 2025-05-18 59/week @ 2025-05-25 22/week @ 2025-06-01 44/week @ 2025-06-08 68/week @ 2025-06-15 34/week @ 2025-06-22 59/week @ 2025-06-29 169/week @ 2025-07-06 69/week @ 2025-07-13 42/week @ 2025-07-20 23/week @ 2025-07-27

329 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