Skip to content

devalain/levenshtein

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

levenshtein

Rust library to compute the Levenshtein distance between words or find the nearest word given a dictionnary.

See the Wikipedia article and the algorithm used is this one. This actual algorithm was inspired by wooorm.

Comparing words

use levenshtein::lev;
let a = "Hello";
let b = "World";
assert_eq!(4, lev(a, b));

Finding the nearest word in a dictionnary

Example dictionnary can be found in this repo.

You can download a dictionnary and try the example called didyoumean like this

cargo run --release --example didyoumean <a word> <a dictionnary filename>

About

Rust library to compute the Levenshtein distance between words

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors