3 releases (1 stable)
1.0.0 | May 31, 2021 |
---|---|
0.2.0 | May 25, 2021 |
0.1.0 | May 19, 2021 |
#4 in #performs
26 downloads per month
Used in calc_engine
13KB
209 lines
auto_correct_n_suggest
Description
A rust Dictionary Trie. Performs autosuggestions on words with typos & autocompletes words 🦀
Installation
Add
auto_correct_n_suggest = "1.0.0"
to your Cargo.toml
How to use
use auto_correct_n_suggest;
let mut dictionary = auto_correct_n_suggest::Dictionary::new();
let word1 = "Dog".to_string();
let word2 = "Dogecoin".to_string();
dictionary.insert(word1);
dictionary.insert(word2);
let words_available = dictionary.find_words_based_on_prefix("Dog".to_string())?; // vec!["Dog", "Dogecoin"]
let typo_auto_suggestions = dictionary.auto_suggest_alternative_words("Dogecoins".to_string())?; // vec!["Dogecoin"]