| Crates.io | correct_word |
| lib.rs | correct_word |
| version | 0.2.0 |
| created_at | 2023-12-17 16:34:14.506688+00 |
| updated_at | 2025-01-02 19:57:29.274373+00 |
| description | A No brainer 'did you mean' library for Rust |
| homepage | |
| repository | https://github.com/newtoallofthis123/correct_word |
| max_upload_size | |
| id | 1072607 |
| size | 10,246 |
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.
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);
}
This project is licensed under the MIT License - see the LICENSE file for details