Go to file
Danny Guo 40c6c99df9 Update the LICENSE
The Levenshtein implementation now has changes that are derived from
https://github.com/wooorm/levenshtein-rs
2018-01-17 10:53:00 -05:00
src Improve Levenshtein performance (#16) 2018-01-17 10:50:58 -05:00
tests Remove the against_vec functions 2018-01-17 10:48:47 -05:00
.editorconfig Add EditorConfig 2016-06-05 03:47:56 -04:00
.gitattributes Let Git normalize line endings 2016-09-24 23:45:57 -04:00
.gitignore Use the official Docker image for Rust 2017-10-11 12:03:09 -04:00
.travis.yml Test against the full Rust suite 2015-10-01 00:01:05 -04:00
appveyor.yml Add configuration for AppVeyor 2016-02-20 12:31:03 -05:00
Cargo.toml Add CI badges to crates.io (#14) 2017-07-24 18:09:46 -05:00
CHANGELOG.md Remove the against_vec functions 2018-01-17 10:48:47 -05:00
dev Improve the dev CLI 2017-11-06 22:01:24 -05:00
LICENSE Update the LICENSE 2018-01-17 10:53:00 -05:00
README.md Remove the against_vec functions 2018-01-17 10:48:47 -05:00

strsim-rs Crates.io Crates.io Linux build status Windows build status

Rust implementations of string similarity metrics:

Installation

# Cargo.toml
[dependencies]
strsim = "0.6.0"

Documentation

You can change the version in the url to see the documentation for an older version in the changelog.

Usage

extern crate strsim;

use strsim::{hamming, levenshtein, osa_distance, damerau_levenshtein, jaro,
             jaro_winkler};

fn main() {
    match hamming("hamming", "hammers") {
        Ok(distance) => assert_eq!(3, distance),
        Err(why) => panic!("{:?}", why)
    }

    assert_eq!(3, levenshtein("kitten", "sitting"));

    assert_eq!(3, osa_distance("ac", "cba"));

    assert_eq!(2, damerau_levenshtein("ac", "cba"));

    assert!((0.392 - jaro("Friedrich Nietzsche", "Jean-Paul Sartre")).abs() <
            0.001);

    assert!((0.911 - jaro_winkler("cheeseburger", "cheese fries")).abs() <
            0.001);
}

Development

If you don't want to install Rust itself, you can run $ ./dev for a development CLI if you have Docker installed.

License

MIT