pub struct NGramTokenizer {
pub min_gram: usize,
pub max_gram: usize,
pub token_chars: Vec<TokenChar>,
}Expand description
Produces n-grams of specified sizes from the input text.
When token_chars is empty, treats the entire input as one token and
generates n-grams from it. When token_chars is non-empty, splits on
characters NOT in the set, then generates n-grams from each word.
Matches ES ngram tokenizer.
See [[analyzers#Tokenizer]].
Fields§
§min_gram: usize§max_gram: usize§token_chars: Vec<TokenChar>Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NGramTokenizer
impl RefUnwindSafe for NGramTokenizer
impl Send for NGramTokenizer
impl Sync for NGramTokenizer
impl Unpin for NGramTokenizer
impl UnsafeUnpin for NGramTokenizer
impl UnwindSafe for NGramTokenizer
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