pub struct TextChunker { /* private fields */ }
Expand description
Text chunker for processing large documents
Implementations§
Source§impl TextChunker
impl TextChunker
Sourcepub fn with_config(config: ChunkingConfig) -> Self
pub fn with_config(config: ChunkingConfig) -> Self
Create a new text chunker with custom configuration
Sourcepub fn chunk_document(
&self,
document: &Document,
) -> LangExtractResult<Vec<TextChunk>>
pub fn chunk_document( &self, document: &Document, ) -> LangExtractResult<Vec<TextChunk>>
Chunk a document into smaller pieces
Sourcepub fn chunk_text(
&self,
text: &str,
document_id: Option<String>,
) -> LangExtractResult<Vec<TextChunk>>
pub fn chunk_text( &self, text: &str, document_id: Option<String>, ) -> LangExtractResult<Vec<TextChunk>>
Chunk text into smaller pieces
Sourcepub fn config(&self) -> &ChunkingConfig
pub fn config(&self) -> &ChunkingConfig
Get chunking configuration
Trait Implementations§
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