7 stable releases

Uses old Rust 2015

2.1.3 Sep 4, 2024
2.1.2 Jun 26, 2024
2.1.0 Mar 2, 2019
2.0.1 Jan 2, 2018
1.0.0 May 1, 2015

#48 in Algorithms

Download history 13133/week @ 2024-08-22 12658/week @ 2024-08-29 13207/week @ 2024-09-05 10509/week @ 2024-09-12 10309/week @ 2024-09-19 13198/week @ 2024-09-26 12101/week @ 2024-10-03 10593/week @ 2024-10-10 12581/week @ 2024-10-17 10376/week @ 2024-10-24 14456/week @ 2024-10-31 12171/week @ 2024-11-07 12022/week @ 2024-11-14 12365/week @ 2024-11-21 10544/week @ 2024-11-28 11884/week @ 2024-12-05

48,922 downloads per month
Used in 91 crates (20 directly)

Apache-2.0

8KB

CI

edit-distance

Calculate Levenshtein distance between two strings.

The Levenshtein edit distance is a measure for the similarity between two strings. It's helpful for spelling correction, fuzzy completion, type-ahead and similar use cases.

This implementation supports Unicode.

Installation

In Cargo.toml add

[dependencies]
edit-distance = "2.1.2"

Then re-run cargo build. That fetches the dependencies and builds the code.

Usage

extern crate edit_distance;

edit_distance("kitten", "sitting"); // => 3

Development

Test changes before comitting.

cargo clean
cargo fmt --all -- --check
cargo build
cargo test

Contributing

Before sending a pull-request that goes beyond a bugfix, please open an issue to discuss. PRs without clear objective or separation of concerns aren't likely to be accepted.

History

2024-06-26 2.1.2 Fix formatting
2024-06-26 2.1.1 Replace CI badge, maintenance
2019-03-02 2.1.0 Optimize memory usage
2018-01-02 2.0.1 Update dev-dependencies
2017-07-02 2.0.0
2015-05-01 1.0.0 Release
2015-04-18 0.0.1 Initial upload

Credits

Thanks to @skade for very helpful criticism of my first rust lib.

License

APL 2.0, see LICENSE file.

No runtime deps