pub struct TrieDictionary<D: Dictionary> { /* private fields */ }Expand description
A Dictionary optimized for pre- and postfix search.
Wraps another dictionary to implement other operations.
Implementations§
Source§impl<D: Dictionary> TrieDictionary<D>
impl<D: Dictionary> TrieDictionary<D>
Trait Implementations§
Source§impl<D: Dictionary> Dictionary for TrieDictionary<D>
impl<D: Dictionary> Dictionary for TrieDictionary<D>
Source§fn contains_word(&self, word: &[char]) -> bool
fn contains_word(&self, word: &[char]) -> bool
Check if the dictionary contains any capitalization of a given word.
Source§fn contains_word_str(&self, word: &str) -> bool
fn contains_word_str(&self, word: &str) -> bool
Check if the dictionary contains any capitalization of a given word.
Source§fn contains_exact_word(&self, word: &[char]) -> bool
fn contains_exact_word(&self, word: &[char]) -> bool
Check if the dictionary contains the exact capitalization of a given word.
Source§fn contains_exact_word_str(&self, word: &str) -> bool
fn contains_exact_word_str(&self, word: &str) -> bool
Check if the dictionary contains the exact capitalization of a given word.
Source§fn fuzzy_match(
&self,
word: &[char],
max_distance: u8,
max_results: usize,
) -> Vec<FuzzyMatchResult<'_>>
fn fuzzy_match( &self, word: &[char], max_distance: u8, max_results: usize, ) -> Vec<FuzzyMatchResult<'_>>
Gets best fuzzy match from dictionary
Source§fn fuzzy_match_str(
&self,
word: &str,
max_distance: u8,
max_results: usize,
) -> Vec<FuzzyMatchResult<'_>>
fn fuzzy_match_str( &self, word: &str, max_distance: u8, max_results: usize, ) -> Vec<FuzzyMatchResult<'_>>
Gets best fuzzy match from dictionary
fn get_correct_capitalization_of(&self, word: &[char]) -> Option<&[char]>
Source§fn get_word_metadata(&self, word: &[char]) -> Option<Cow<'_, DictWordMetadata>>
fn get_word_metadata(&self, word: &[char]) -> Option<Cow<'_, DictWordMetadata>>
Get the associated
DictWordMetadata for any capitalization of a given word.Source§fn get_word_metadata_str(&self, word: &str) -> Option<Cow<'_, DictWordMetadata>>
fn get_word_metadata_str(&self, word: &str) -> Option<Cow<'_, DictWordMetadata>>
Get the associated
DictWordMetadata for any capitalization of a given word.
If the word isn’t in the dictionary, the resulting metadata will be
empty.Source§fn words_iter(&self) -> Box<dyn Iterator<Item = &[char]> + Send + '_>
fn words_iter(&self) -> Box<dyn Iterator<Item = &[char]> + Send + '_>
Iterate over the words in the dictionary.
Source§fn word_count(&self) -> usize
fn word_count(&self) -> usize
The number of words in the dictionary.
Source§fn get_word_from_id(&self, id: &WordId) -> Option<&[char]>
fn get_word_from_id(&self, id: &WordId) -> Option<&[char]>
Returns the correct capitalization of the word with the given ID.
Auto Trait Implementations§
impl<D> Freeze for TrieDictionary<D>where
D: Freeze,
impl<D> RefUnwindSafe for TrieDictionary<D>where
D: RefUnwindSafe,
impl<D> Send for TrieDictionary<D>
impl<D> Sync for TrieDictionary<D>
impl<D> Unpin for TrieDictionary<D>where
D: Unpin,
impl<D> UnwindSafe for TrieDictionary<D>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more