pub struct Suggester<'a, S: BuildHasher> { /* private fields */ }Expand description
A wrapper struct for a dictionary that allows customizing suggestion behavior.
Currently only ngram suggestions may be configured.
Implementations§
Source§impl<'a, S: BuildHasher> Suggester<'a, S>
impl<'a, S: BuildHasher> Suggester<'a, S>
Sourcepub fn into_checker(self) -> Checker<'a, S>
pub fn into_checker(self) -> Checker<'a, S>
Returns the underlying Checker used by this suggester.
Sourcepub fn with_ngram_suggestions(self, ngram_suggest: bool) -> Self
pub fn with_ngram_suggestions(self, ngram_suggest: bool) -> Self
Enables or disables the suggester from finding suggestions based on “ngram similarity.”
Ngram similarity is a bespoke string similarity metric used by the suggester to find suggestions when string edits don’t produce any likely candidates. Finding a suggestion with ngram similarity involves iterating through the dictionary’s wordlist and therefore ngram suggestion can be very slow depending on the dictionary size.
Ngram suggestion is enabled by default.
Trait Implementations§
Source§impl<S: BuildHasher> Debug for Suggester<'_, S>
impl<S: BuildHasher> Debug for Suggester<'_, S>
impl<'a, S: Copy + BuildHasher> Copy for Suggester<'a, S>
Auto Trait Implementations§
impl<'a, S> Freeze for Suggester<'a, S>
impl<'a, S> RefUnwindSafe for Suggester<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for Suggester<'a, S>where
S: Sync,
impl<'a, S> Sync for Suggester<'a, S>where
S: Sync,
impl<'a, S> Unpin for Suggester<'a, S>
impl<'a, S> UnsafeUnpin for Suggester<'a, S>
impl<'a, S> UnwindSafe for Suggester<'a, S>where
S: RefUnwindSafe,
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