pub struct TextChunker;Expand description
Text chunking utilities
Implementations§
Source§impl TextChunker
impl TextChunker
Sourcepub fn split_text(text: &str, chunk_size: usize, overlap: usize) -> Vec<String>
pub fn split_text(text: &str, chunk_size: usize, overlap: usize) -> Vec<String>
Split text into chunks of specified size with overlap
Sourcepub fn split_by_sentences(text: &str) -> Vec<String>
pub fn split_by_sentences(text: &str) -> Vec<String>
Split text by sentences
Sourcepub fn split_by_paragraphs(text: &str) -> Vec<String>
pub fn split_by_paragraphs(text: &str) -> Vec<String>
Split text by paragraphs
Auto Trait Implementations§
impl Freeze for TextChunker
impl RefUnwindSafe for TextChunker
impl Send for TextChunker
impl Sync for TextChunker
impl Unpin for TextChunker
impl UnwindSafe for TextChunker
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