4 releases

0.2.0 Jan 2, 2025
0.1.2 Dec 22, 2023
0.1.1 Dec 17, 2023
0.1.0 Dec 17, 2023

#807 in Text processing

Download history 5/week @ 2024-09-24 1/week @ 2024-10-08 1/week @ 2024-10-15 3/week @ 2024-10-29 6/week @ 2024-11-05 1/week @ 2024-12-03 13/week @ 2024-12-10 2/week @ 2024-12-17 152/week @ 2024-12-31 18/week @ 2025-01-07

173 downloads per month
Used in 2 crates

MIT license

10KB
77 lines

Correct Word

A no brain "did you mean" suggestions generator written in Rust. Plans to use a weird array of algorithms to get the best results. But for now, it only uses the Levenshtein distance.

Usage

Complete docs can be found here.

use correct_word::correct_word;
use correct_word::Algorithm;

fn main() {
    let word = "helo";
    let dictionary = vec!["hello", "world", "hell", "help", "helo", "hola"];
    let suggestion = correct_word(Algorithm::Levenshtein, word, dictionary, None);
    println!("{} with confidence {}", suggestion.0, suggestion.1);
}

License

This project is licensed under the MIT License - see the LICENSE file for details

No runtime deps