pub struct Preprocessor {
pub normalize_unicode: bool,
pub collapse_whitespace: bool,
pub trim: bool,
pub to_lowercase: bool,
pub remove_stopwords: bool,
pub stopwords: Vec<String>,
pub max_length: usize,
}Expand description
Configuration for text preprocessing.
Fields§
§normalize_unicode: boolWhether to normalize unicode to NFC form.
collapse_whitespace: boolWhether to collapse whitespace to single spaces.
trim: boolWhether to trim leading/trailing whitespace.
to_lowercase: boolWhether to convert to lowercase.
remove_stopwords: boolWhether to remove stop words.
stopwords: Vec<String>Custom stop words (if empty, uses built-in default set).
max_length: usizeMaximum string length to process (0 = unlimited).
Implementations§
Source§impl Preprocessor
impl Preprocessor
Sourcepub fn with_normalize_unicode(self, v: bool) -> Self
pub fn with_normalize_unicode(self, v: bool) -> Self
Set unicode normalization.
Sourcepub fn with_collapse_whitespace(self, v: bool) -> Self
pub fn with_collapse_whitespace(self, v: bool) -> Self
Set whitespace collapsing.
Sourcepub fn with_lowercase(self, v: bool) -> Self
pub fn with_lowercase(self, v: bool) -> Self
Set lowercase conversion.
Sourcepub fn with_remove_stopwords(self, v: bool) -> Self
pub fn with_remove_stopwords(self, v: bool) -> Self
Set stopword removal.
Sourcepub fn with_stopwords(self, words: Vec<String>) -> Self
pub fn with_stopwords(self, words: Vec<String>) -> Self
Set custom stop words.
Sourcepub fn with_max_length(self, max: usize) -> Self
pub fn with_max_length(self, max: usize) -> Self
Set max input length.
Trait Implementations§
Source§impl Clone for Preprocessor
impl Clone for Preprocessor
Source§fn clone(&self) -> Preprocessor
fn clone(&self) -> Preprocessor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Preprocessor
impl Debug for Preprocessor
Auto Trait Implementations§
impl Freeze for Preprocessor
impl RefUnwindSafe for Preprocessor
impl Send for Preprocessor
impl Sync for Preprocessor
impl Unpin for Preprocessor
impl UnsafeUnpin for Preprocessor
impl UnwindSafe for Preprocessor
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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