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

#10 in #longest

Download history 213/week @ 2024-04-08 183/week @ 2024-04-15 50/week @ 2024-04-22 42/week @ 2024-04-29 47/week @ 2024-05-06 228/week @ 2024-05-13 426/week @ 2024-05-20 312/week @ 2024-05-27 258/week @ 2024-06-03 154/week @ 2024-06-10 37/week @ 2024-06-17 68/week @ 2024-06-24 68/week @ 2024-07-01 98/week @ 2024-07-08 83/week @ 2024-07-15 84/week @ 2024-07-22

338 downloads per month
Used in 2 crates

MIT license

10KB
168 lines

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


lib.rs:

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.

No runtime deps