pub struct Analyzer { /* private fields */ }Expand description
A complete text analysis pipeline: char filters + tokenizer + token filters.
Combines zero or more CharFilters, a single Tokenizer, and zero or
more TokenFilters. Character filters preprocess the raw text, the
tokenizer breaks it into tokens, then each token filter transforms the
stream in order.
See [[analyzers#Pipeline Stages]].
Implementations§
Source§impl Analyzer
impl Analyzer
Sourcepub fn new(
name: impl Into<String>,
tokenizer: impl Tokenizer + 'static,
filters: Vec<Box<dyn TokenFilter>>,
) -> Self
pub fn new( name: impl Into<String>, tokenizer: impl Tokenizer + 'static, filters: Vec<Box<dyn TokenFilter>>, ) -> Self
Create a new analyzer with the given name, tokenizer, and filters.
Sourcepub fn with_char_filters(
name: impl Into<String>,
char_filters: Vec<Box<dyn CharFilter>>,
tokenizer: impl Tokenizer + 'static,
filters: Vec<Box<dyn TokenFilter>>,
) -> Self
pub fn with_char_filters( name: impl Into<String>, char_filters: Vec<Box<dyn CharFilter>>, tokenizer: impl Tokenizer + 'static, filters: Vec<Box<dyn TokenFilter>>, ) -> Self
Create a new analyzer with char filters, tokenizer, and token filters.
Sourcepub fn from_boxed(
name: impl Into<String>,
char_filters: Vec<Box<dyn CharFilter>>,
tokenizer: Box<dyn Tokenizer>,
filters: Vec<Box<dyn TokenFilter>>,
) -> Self
pub fn from_boxed( name: impl Into<String>, char_filters: Vec<Box<dyn CharFilter>>, tokenizer: Box<dyn Tokenizer>, filters: Vec<Box<dyn TokenFilter>>, ) -> Self
Create from already-boxed components (used by config builder).
Auto Trait Implementations§
impl !RefUnwindSafe for Analyzer
impl !UnwindSafe for Analyzer
impl Freeze for Analyzer
impl Send for Analyzer
impl Sync for Analyzer
impl Unpin for Analyzer
impl UnsafeUnpin for Analyzer
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