Struct dym::Lexicon
[−]
[src]
pub struct Lexicon { /* fields omitted */ }
Methods
impl Lexicon
[src]
fn new() -> Self
Creates an empty Lexicon
fn insert(&mut self, word: &str)
Inserts a copy of the given word into the Lexicon after converting it to lowercase and trimming whitespace
fn insert_all(&mut self, words: &[&str])
Inserts a copy of all given words into the Lexicon after converting them to lowercase and trimming whitespace
fn contains(&self, word: &str) -> bool
Returns true if the Lexicon contains the given word
fn corrections_for(&self, word: &str) -> Vec<String>
Returns all words in the Lexicon that are at most two edits away from the given word.