#text-processing #search #spelling

edit-distance

Levenshtein edit distance between strings, a measure for similarity

4 stable releases

2.1.0 Mar 2, 2019
2.0.1 Jan 2, 2018
2.0.0 Jul 2, 2017
1.0.0 May 1, 2015

#31 in Text processing

Download history 2277/week @ 2019-12-10 2335/week @ 2019-12-17 1176/week @ 2019-12-24 1261/week @ 2019-12-31 2170/week @ 2020-01-07 2113/week @ 2020-01-14 1628/week @ 2020-01-21 1991/week @ 2020-01-28 1990/week @ 2020-02-04 1832/week @ 2020-02-11 1650/week @ 2020-02-18 1420/week @ 2020-02-25 1445/week @ 2020-03-03 1605/week @ 2020-03-10 2617/week @ 2020-03-17 1589/week @ 2020-03-24

9,077 downloads per month
Used in 56 crates (7 directly)

Apache-2.0

8KB

edit-distance

Build Status

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.0"

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

Usage

extern crate edit_distance;

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

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Test your changes: cargo test
  4. Commit your changes: git commit -am 'Add some feature'
  5. Push to the branch: git push origin my-new-feature
  6. Submit a pull request :D

History

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