leven-distance 1.0.0

Compute operational differences between two sequences using the Levenshtein algorithm.
Documentation
  • Coverage
  • 66.67%
    2 out of 3 items documented0 out of 0 items with examples
  • Size
  • Source code size: 15.29 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 563.62 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • syn-chromatic/levenshtein-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • syn-chromatic

Levenshtein

Compute operational differences between two sequences using the Levenshtein algorithm.

Add to Cargo.toml

leven-distance = "*"

Usage:

Basic Usage

use levenshtein::Levenshtein;
use levenshtein::Results;

fn main() {
    let mut levenshtein: Levenshtein = Levenshtein::new();

    // Specify costs as you see fit, the default is 1 for all parameters.
    levenshtein.set_insert_cost(2);
    levenshtein.set_replace_cost(2);
    levenshtein.set_delete_cost(2);

    let results: Results = levenshtein.calculate("test", "text");

    let distance: i32 = results.distance();
    let sequence: &Vec<Vec<i32>> = results.sequence();

    println!("Distance: {}", distance);
    println!("Sequence: {:#?}", sequence);
}

License

This project is licensed under the MIT License.
See the LICENSE file for more information.