| Crates.io | auto_correct_n_suggest |
| lib.rs | auto_correct_n_suggest |
| version | 1.0.0 |
| created_at | 2021-05-19 11:09:23.953032+00 |
| updated_at | 2021-05-31 17:07:56.340735+00 |
| description | A rust Dictionary Trie. Performs autosuggestions on words with typos & autocompletes words 🦀 |
| homepage | |
| repository | https://github.com/Tevinthuku/rust-dictionary-autocomplete-autosuggest |
| max_upload_size | |
| id | 399518 |
| size | 13,265 |
A rust Dictionary Trie. Performs autosuggestions on words with typos & autocompletes words 🦀
Add
auto_correct_n_suggest = "1.0.0"
to your Cargo.toml
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"]