correct_word

Crates.iocorrect_word
lib.rscorrect_word
version0.1.2
sourcesrc
created_at2023-12-17 16:34:14.506688
updated_at2023-12-22 13:32:47.195492
descriptionA No brainer 'did you mean' library for Rust
homepage
repositoryhttps://github.com/newtoallofthis123/correct_word
max_upload_size
id1072607
size9,162
Ishan Joshi (newtoallofthis123)

documentation

README

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

Commit count: 6

cargo fmt