Struct spellcheck::Speller [−][src]
Fields
letters: String
The letters of the alphabet.
n_words: HashMap<String, u32>
A frequency map of words to the number of times they were found during training.
Methods
impl Speller
[src]
impl Speller
pub fn train(&mut self, text: &str)
[src]
pub fn train(&mut self, text: &str)
A function that trains the language model with the words in the supplied text. Multiple invocation of this function can extend the training of the model.
pub fn correct(&mut self, word: &str) -> String
[src]
pub fn correct(&mut self, word: &str) -> String
A function that returns the correction for the specified word.