{"id":13632403,"url":"https://github.com/rapidfuzz/strsim-rs","last_synced_at":"2025-06-17T18:08:43.010Z","repository":{"id":27100354,"uuid":"30567707","full_name":"rapidfuzz/strsim-rs","owner":"rapidfuzz","description":":abc: Rust implementations of string similarity metrics","archived":false,"fork":false,"pushed_at":"2024-04-03T11:36:38.000Z","size":719,"stargazers_count":439,"open_issues_count":10,"forks_count":42,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-06-13T00:05:35.927Z","etag":null,"topics":["damerau-levenshtein","edit-distance","jaro","jaro-winkler","levenshtein","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/strsim","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rapidfuzz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["dguo","maxbachmann"],"ko_fi":"dannyguo","liberapay":"dannyguo","custom":["https://www.paypal.com/donate/?hosted_button_id=VGWQBBD5CTWJU","https://www.paypal.com/paypalme/DannyGuo","https://www.buymeacoffee.com/dannyguo"]}},"created_at":"2015-02-10T01:04:10.000Z","updated_at":"2025-05-31T23:15:18.000Z","dependencies_parsed_at":"2024-06-11T16:27:29.402Z","dependency_job_id":"4bed8e0a-0367-4b45-8409-b00c86f0ec3a","html_url":"https://github.com/rapidfuzz/strsim-rs","commit_stats":null,"previous_names":["rapidfuzz/strsim-rs","dguo/strsim-rs"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/rapidfuzz/strsim-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapidfuzz%2Fstrsim-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapidfuzz%2Fstrsim-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapidfuzz%2Fstrsim-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapidfuzz%2Fstrsim-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rapidfuzz","download_url":"https://codeload.github.com/rapidfuzz/strsim-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapidfuzz%2Fstrsim-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260263761,"owners_count":22982757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["damerau-levenshtein","edit-distance","jaro","jaro-winkler","levenshtein","rust"],"created_at":"2024-08-01T22:03:02.413Z","updated_at":"2025-06-17T18:08:42.970Z","avatar_url":"https://github.com/rapidfuzz.png","language":"Rust","readme":"# strsim-rs\n\n[![Crates.io](https://img.shields.io/crates/v/strsim.svg)](https://crates.io/crates/strsim)\n[![Crates.io](https://img.shields.io/crates/l/strsim.svg?maxAge=2592000)](https://github.com/rapidfuzz/strsim-rs/blob/main/LICENSE)\n[![CI status](https://github.com/rapidfuzz/strsim-rs/workflows/CI/badge.svg)](https://github.com/rapidfuzz/strsim-rs/actions?query=branch%3Amain)\n[![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/)\n\n[Rust](https://www.rust-lang.org) implementations of [string similarity metrics]:\n  - [Hamming]\n  - [Levenshtein] - distance \u0026 normalized\n  - [Optimal string alignment]\n  - [Damerau-Levenshtein] - distance \u0026 normalized\n  - [Jaro and Jaro-Winkler]\n  - [Sørensen-Dice]\n\nThe normalized versions return values between `0.0` and `1.0`, where `1.0` means\nan exact match.\n\nThere are also generic versions of the functions for non-string inputs.\n\n## Installation\n\n`strsim` is available on [crates.io](https://crates.io/crates/strsim). Add it to\nyour project:\n\n```sh\ncargo add strsim\n```\n\n## Usage\n\nGo to [Docs.rs](https://docs.rs/strsim/) for the full documentation. You can\nalso clone the repo, and run `$ cargo doc --open`.\n\n### Examples\n\n```rust\nextern crate strsim;\n\nuse strsim::{hamming, levenshtein, normalized_levenshtein, osa_distance,\n             damerau_levenshtein, normalized_damerau_levenshtein, jaro,\n             jaro_winkler, sorensen_dice};\n\nfn main() {\n    match hamming(\"hamming\", \"hammers\") {\n        Ok(distance) =\u003e assert_eq!(3, distance),\n        Err(why) =\u003e panic!(\"{:?}\", why)\n    }\n\n    assert_eq!(levenshtein(\"kitten\", \"sitting\"), 3);\n\n    assert!((normalized_levenshtein(\"kitten\", \"sitting\") - 0.571).abs() \u003c 0.001);\n\n    assert_eq!(osa_distance(\"ac\", \"cba\"), 3);\n\n    assert_eq!(damerau_levenshtein(\"ac\", \"cba\"), 2);\n\n    assert!((normalized_damerau_levenshtein(\"levenshtein\", \"löwenbräu\") - 0.272).abs() \u003c\n            0.001);\n\n    assert!((jaro(\"Friedrich Nietzsche\", \"Jean-Paul Sartre\") - 0.392).abs() \u003c\n            0.001);\n\n    assert!((jaro_winkler(\"cheeseburger\", \"cheese fries\") - 0.911).abs() \u003c\n            0.001);\n\n    assert_eq!(sorensen_dice(\"web applications\", \"applications of the web\"),\n        0.7878787878787878);\n}\n```\n\nUsing the generic versions of the functions:\n\n```rust\nextern crate strsim;\n\nuse strsim::generic_levenshtein;\n\nfn main() {\n    assert_eq!(2, generic_levenshtein(\u0026[1, 2, 3], \u0026[0, 2, 5]));\n}\n```\n\n## Contributing\n\nIf you don't want to install Rust itself, you can run `$ ./dev` for a\ndevelopment CLI if you have [Docker] installed.\n\nBenchmarks require a Nightly toolchain. Run `$ cargo +nightly bench`.\n\n## License\n\n[MIT](https://github.com/rapidfuzz/strsim-rs/blob/main/LICENSE)\n\n[string similarity metrics]:http://en.wikipedia.org/wiki/String_metric\n[Damerau-Levenshtein]:http://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance\n[Jaro and Jaro-Winkler]:http://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance\n[Levenshtein]:http://en.wikipedia.org/wiki/Levenshtein_distance\n[Hamming]:http://en.wikipedia.org/wiki/Hamming_distance\n[Optimal string alignment]:https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance#Optimal_string_alignment_distance\n[Sørensen-Dice]:http://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient\n[Docker]:https://docs.docker.com/engine/installation/\n","funding_links":["https://github.com/sponsors/dguo","https://github.com/sponsors/maxbachmann","https://ko-fi.com/dannyguo","https://liberapay.com/dannyguo","https://www.paypal.com/donate/?hosted_button_id=VGWQBBD5CTWJU","https://www.paypal.com/paypalme/DannyGuo","https://www.buymeacoffee.com/dannyguo"],"categories":["Rust","Libraries"],"sub_categories":["Text processing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapidfuzz%2Fstrsim-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frapidfuzz%2Fstrsim-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapidfuzz%2Fstrsim-rs/lists"}