Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wooorm/levenshtein-rs
Levenshtein algorithm in Rust
https://github.com/wooorm/levenshtein-rs
levenshtein rust
Last synced: 3 days ago
JSON representation
Levenshtein algorithm in Rust
- Host: GitHub
- URL: https://github.com/wooorm/levenshtein-rs
- Owner: wooorm
- License: mit
- Created: 2016-02-09T16:08:20.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2021-03-15T19:37:49.000Z (over 3 years ago)
- Last Synced: 2024-04-14T08:44:42.555Z (7 months ago)
- Topics: levenshtein, rust
- Language: Rust
- Size: 19.5 KB
- Stars: 45
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: funding.yml
- License: license
Awesome Lists containing this project
README
# levenshtein.rs
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Crate][crate-badge]][crate]Vladimir Levenshtein’s [edit distance algorithm][wiki] as a Rust
library. There’s also a [C library][c-api], [C user command][c-cli],
and [JavaScript module][js-api].> :tada: This is my first attempt at Rust!
## Installation
[Cargo][]:
```toml
[dependencies]
levenshtein = "1.0.5"
```## Usage
```rust
extern crate levenshtein;
use levenshtein::levenshtein;fn main() {
println!("{}", levenshtein("kitten", "sitting"));
}
```Yields:
```txt
3
```## API
### `fn levenshtein(a: &str, b: &str) -> usize`
Given two strings, returns the edit distance between them.
## License
[MIT][license] © [Titus Wormer][author]
[build-badge]: https://github.com/wooorm/levenshtein-rs/workflows/main/badge.svg
[build]: https://github.com/wooorm/levenshtein-rs/actions
[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/levenshtein-rs.svg
[coverage]: https://codecov.io/github/wooorm/levenshtein-rs
[crate-badge]: https://img.shields.io/crates/v/levenshtein.svg
[crate]: https://crates.io/crates/levenshtein
[license]: license
[author]: https://wooorm.com
[cargo]: https://crates.io
[wiki]: https://en.wikipedia.org/wiki/Levenshtein_distance
[c-cli]: https://github.com/wooorm/levenshtein
[c-api]: https://github.com/wooorm/levenshtein.c
[js-api]: https://github.com/words/levenshtein-edit-distance