pub struct DynamicStemmer { /* private fields */ }Expand description
Stemmer whose language is selected per call from the tokenizer hint.
The hint is a comma-separated list of language codes or names ("ru,en").
Each token is stemmed with the first hinted language whose script matches
the token’s script; tokens of a script no hinted language covers are kept
as cleaned (lowercased, punctuation stripped) text. Without a hint the
default language applies, or plain cleaning when it is None.
Because Snowball stemmers are script-local, one field can hold mixed Cyrillic/Latin documents and still stem each part correctly.
Declared in SDL as text<stem(by: <field>, default: <language|simple>)>;
see TokenizerSpec.
Implementations§
Source§impl DynamicStemmer
impl DynamicStemmer
Sourcepub fn new(default: Option<Language>) -> Self
pub fn new(default: Option<Language>) -> Self
Create a dynamic stemmer; default applies when no hint is present.
Sourcepub fn default_language(&self) -> Option<Language>
pub fn default_language(&self) -> Option<Language>
Default language used when no hint is given.
Sourcepub fn parse_hint(hint: &str) -> Vec<Language>
pub fn parse_hint(hint: &str) -> Vec<Language>
Parse a hint into the ordered list of recognised languages.
Trait Implementations§
Source§impl Clone for DynamicStemmer
impl Clone for DynamicStemmer
Source§fn clone(&self) -> DynamicStemmer
fn clone(&self) -> DynamicStemmer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DynamicStemmer
impl Debug for DynamicStemmer
Source§impl Default for DynamicStemmer
impl Default for DynamicStemmer
Source§fn default() -> DynamicStemmer
fn default() -> DynamicStemmer
Auto Trait Implementations§
impl Freeze for DynamicStemmer
impl RefUnwindSafe for DynamicStemmer
impl Send for DynamicStemmer
impl Sync for DynamicStemmer
impl Unpin for DynamicStemmer
impl UnsafeUnpin for DynamicStemmer
impl UnwindSafe for DynamicStemmer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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