pub struct TextProcessor;Expand description
Text processing utilities
Implementations§
Source§impl TextProcessor
impl TextProcessor
Sourcepub fn split_sentences(text: &str) -> Vec<String>
pub fn split_sentences(text: &str) -> Vec<String>
Split text into sentences with fallback to words
Sourcepub fn split_sentences_advanced(
text: &str,
options: SentenceSplitOptions,
) -> Vec<String>
pub fn split_sentences_advanced( text: &str, options: SentenceSplitOptions, ) -> Vec<String>
Split sentences with configurable options
Sourcepub fn extract_code_fences(text: &str) -> Vec<TextPart>
pub fn extract_code_fences(text: &str) -> Vec<TextPart>
Extract code fences and text parts with better error handling
Sourcepub fn extract_code_fences_with_options(
text: &str,
options: CodeFenceOptions,
) -> Vec<TextPart>
pub fn extract_code_fences_with_options( text: &str, options: CodeFenceOptions, ) -> Vec<TextPart>
Extract code fences with configurable options
Sourcepub fn normalize_text(text: &str) -> String
pub fn normalize_text(text: &str) -> String
Normalize text to NFC form
Sourcepub fn tokenize(text: &str) -> Vec<String>
pub fn tokenize(text: &str) -> Vec<String>
Tokenize text for search (similar to TF-IDF processing) with better performance
Sourcepub fn tokenize_with_options(
text: &str,
options: TokenizeOptions,
) -> Vec<String>
pub fn tokenize_with_options( text: &str, options: TokenizeOptions, ) -> Vec<String>
Tokenize with configurable options
Auto Trait Implementations§
impl Freeze for TextProcessor
impl RefUnwindSafe for TextProcessor
impl Send for TextProcessor
impl Sync for TextProcessor
impl Unpin for TextProcessor
impl UnwindSafe for TextProcessor
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