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

#1727 in Algorithms

Download history 94/week @ 2024-02-15 97/week @ 2024-02-22 60/week @ 2024-02-29 82/week @ 2024-03-07 71/week @ 2024-03-14 57/week @ 2024-03-21 189/week @ 2024-03-28 126/week @ 2024-04-04 332/week @ 2024-04-11 63/week @ 2024-04-18 50/week @ 2024-04-25 47/week @ 2024-05-02 126/week @ 2024-05-09 337/week @ 2024-05-16 358/week @ 2024-05-23 299/week @ 2024-05-30

1,126 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