pub struct ChunkText { /* private fields */ }
Expand description
A transformer that chunks text content into smaller pieces.
The transformer will split the text content into smaller pieces based on the specified
max_characters
or range
of characters.
For further customization, you can use the builder to create a custom splitter. Uses
text_splitter
under the hood.
Technically that might work with every splitter text_splitter
provides.
Implementations§
Source§impl ChunkText
impl ChunkText
pub fn builder() -> ChunkTextBuilder
Sourcepub fn from_max_characters(max_characters: usize) -> Self
pub fn from_max_characters(max_characters: usize) -> Self
Create a new transformer with a maximum number of characters per chunk.
Sourcepub fn from_chunk_range(range: Range<usize>) -> Self
pub fn from_chunk_range(range: Range<usize>) -> Self
Create a new transformer with a range of characters per chunk.
Chunks smaller than the range will be ignored.
Sourcepub fn with_concurrency(self, concurrency: usize) -> Self
pub fn with_concurrency(self, concurrency: usize) -> Self
Set the number of concurrent chunks to process.
Trait Implementations§
Source§impl ChunkerTransformer for ChunkText
impl ChunkerTransformer for ChunkText
fn transform_node<'life0, 'async_trait>(
&'life0 self,
node: Node,
) -> Pin<Box<dyn Future<Output = IndexingStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn concurrency(&self) -> Option<usize>
fn concurrency(&self) -> Option<usize>
Overrides the default concurrency of the pipeline
fn name(&self) -> &'static str
Auto Trait Implementations§
impl Freeze for ChunkText
impl RefUnwindSafe for ChunkText
impl Send for ChunkText
impl Sync for ChunkText
impl Unpin for ChunkText
impl UnwindSafe for ChunkText
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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