Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 1.58 KB

README.md

File metadata and controls

56 lines (39 loc) · 1.58 KB

Leven

Welcome to Leven, an efficient, tabulated implementation of the Levenshtein distance algorithm in Elixir. The Levenshtein distance, also known as edit distance, measures the difference between two strings in terms of the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into the other.

Hex.pm Version Hex Docs Hex.pm License

Installation

The package can be installed by adding leven to your list of dependencies in mix.exs:

def deps do
  [
    {:leven, "~> 1.0"}
  ]
end

Example

iex(1)> Leven.distance("house", "horses")
2

Two single-character edits are required to get from "house" to "horses":

  1. Substitute "u" for "r", resulting in "horse"
  2. Appens "s", resulting in "horses"

Benchmarks

To benchmark Leven on your machine, clone the repo and run mix bench.

License

Leven is released under the Apache License 2.0.

About

This package was written by Elliot Jackson.