pub struct FstDictionary { /* private fields */ }
Implementations§
Source§impl FstDictionary
impl FstDictionary
Sourcepub fn curated() -> Arc<Self>
pub fn curated() -> Arc<Self>
Create a dictionary from the curated dictionary included in the Harper binary.
pub fn new(new_words: HashMap<CharString, WordMetadata>) -> Self
Trait Implementations§
Source§impl Dictionary for FstDictionary
impl Dictionary for FstDictionary
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 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(&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 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 FstDictionary
impl PartialEq for FstDictionary
Auto Trait Implementations§
impl Freeze for FstDictionary
impl RefUnwindSafe for FstDictionary
impl Send for FstDictionary
impl Sync for FstDictionary
impl Unpin for FstDictionary
impl UnwindSafe for FstDictionary
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