pub struct TextPreprocessor;Expand description
Text preprocessing utilities
Implementations§
Source§impl TextPreprocessor
impl TextPreprocessor
Sourcepub fn clean_text(text: &str) -> String
pub fn clean_text(text: &str) -> String
Clean text by removing extra whitespace and normalizing
Remove HTML tags from text
Sourcepub fn normalize_whitespace(text: &str) -> String
pub fn normalize_whitespace(text: &str) -> String
Normalize whitespace
Sourcepub fn extract_keywords(text: &str, max_keywords: usize) -> Vec<String>
pub fn extract_keywords(text: &str, max_keywords: usize) -> Vec<String>
Extract keywords from text
Sourcepub fn truncate_text(text: &str, max_length: usize) -> String
pub fn truncate_text(text: &str, max_length: usize) -> String
Truncate text to maximum length while preserving word boundaries
Sourcepub fn expand_contractions(text: &str) -> String
pub fn expand_contractions(text: &str) -> String
Expand contractions in text
Auto Trait Implementations§
impl Freeze for TextPreprocessor
impl RefUnwindSafe for TextPreprocessor
impl Send for TextPreprocessor
impl Sync for TextPreprocessor
impl Unpin for TextPreprocessor
impl UnwindSafe for TextPreprocessor
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