levenshtein

Crates.iolevenshtein
lib.rslevenshtein
version1.0.5
sourcesrc
created_at2016-02-09 16:11:54.828913
updated_at2021-02-22 09:21:50.932859
descriptionLevenshtein algorithm
homepage
repositoryhttps://github.com/wooorm/levenshtein-rs
max_upload_size
id4137
size3,035
Titus (wooorm)

documentation

README

levenshtein.rs

Build Coverage Crate

Vladimir Levenshtein’s edit distance algorithm as a Rust library. There’s also a C library, C user command, and JavaScript module.

:tada: This is my first attempt at Rust!

Installation

Cargo:

[dependencies]
levenshtein = "1.0.5"

Usage

extern crate levenshtein;
use levenshtein::levenshtein;

fn main() {
    println!("{}", levenshtein("kitten", "sitting"));
}

Yields:

3

API

fn levenshtein(a: &str, b: &str) -> usize

Given two strings, returns the edit distance between them.

License

MIT © Titus Wormer

Commit count: 23

cargo fmt