pub struct MergedDictionary { /* private fields */ }
Expand description
A simple wrapper over Dictionary
that allows
one to merge multiple dictionaries without copying.
Implementations§
Source§impl MergedDictionary
impl MergedDictionary
pub fn new() -> Self
pub fn add_dictionary(&mut self, dictionary: Arc<dyn Dictionary>)
Trait Implementations§
Source§impl Clone for MergedDictionary
impl Clone for MergedDictionary
Source§fn clone(&self) -> MergedDictionary
fn clone(&self) -> MergedDictionary
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for MergedDictionary
impl Default for MergedDictionary
Source§impl Dictionary for MergedDictionary
impl Dictionary for MergedDictionary
Source§fn contains_word(&self, word: &[char]) -> bool
fn contains_word(&self, word: &[char]) -> bool
Check if the dictionary contains a given word.
Source§fn get_word_metadata(&self, word: &[char]) -> WordMetadata
fn get_word_metadata(&self, word: &[char]) -> WordMetadata
Get the associated
WordMetadata
for 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 words_with_len_iter(
&self,
len: usize,
) -> Box<dyn Iterator<Item = &[char]> + Send + '_>
fn words_with_len_iter( &self, len: usize, ) -> Box<dyn Iterator<Item = &[char]> + Send + '_>
Iterate over all the words in the dictionary of a given length
Source§fn contains_word_str(&self, word: &str) -> bool
fn contains_word_str(&self, word: &str) -> bool
Check if the dictionary contains a given word.
Source§fn get_word_metadata_str(&self, word: &str) -> WordMetadata
fn get_word_metadata_str(&self, word: &str) -> WordMetadata
Get the associated
WordMetadata
for a given word.
If the word isn’t in the dictionary, the resulting metadata will be
empty.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
Source§impl PartialEq for MergedDictionary
impl PartialEq for MergedDictionary
Auto Trait Implementations§
impl Freeze for MergedDictionary
impl !RefUnwindSafe for MergedDictionary
impl Send for MergedDictionary
impl Sync for MergedDictionary
impl Unpin for MergedDictionary
impl !UnwindSafe for MergedDictionary
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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