Giter Club home page Giter Club logo

edit-distance's Introduction

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

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

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Develop your changes (see details above)
  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.

edit-distance's People

Contributors

casey avatar febeling avatar ignatenkobrain avatar kjgorman avatar skade avatar wenmuzhou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

edit-distance's Issues

Use a generic type paramater

This would be a very small non-breaking ergonomic improvement: it would be nice if the input types were AsRef<str>, which would let the function transparently accept both String and &str.

If this is interesting to you I'd be happy to PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.