pub struct ShingleFilter {
pub min_size: usize,
pub max_size: usize,
pub output_unigrams: bool,
pub separator: String,
pub filler_token: String,
}Expand description
Produces word-level n-grams (shingles) from the token stream.
For example, with min_size=2, max_size=2, tokens [the, quick, brown]
produce shingles [the quick, quick brown] (and optionally the original
unigrams).
Matches ES shingle token filter.
See [[analyzers#Token Filters]].
Fields§
§min_size: usize§max_size: usize§output_unigrams: bool§separator: String§filler_token: StringImplementations§
Trait Implementations§
Source§impl TokenFilter for ShingleFilter
impl TokenFilter for ShingleFilter
Auto Trait Implementations§
impl Freeze for ShingleFilter
impl RefUnwindSafe for ShingleFilter
impl Send for ShingleFilter
impl Sync for ShingleFilter
impl Unpin for ShingleFilter
impl UnsafeUnpin for ShingleFilter
impl UnwindSafe for ShingleFilter
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