pub struct MarkdownTextSplitter { /* private fields */ }Expand description
Markdown-aware text splitter
Splits markdown documents while respecting header hierarchy. HYBRID: Simple by default, powerful when needed.
§Simple Usage (Default)
use vecstore::text_splitter::{MarkdownTextSplitter, TextSplitter};
// Just works - splits on markdown boundaries
let splitter = MarkdownTextSplitter::new(500, 50);
let chunks = splitter.split_text("# Title\n\nContent...")?;§Advanced Usage (Optional)
use vecstore::text_splitter::{MarkdownTextSplitter, TextSplitter};
// Preserve header context in each chunk
let splitter = MarkdownTextSplitter::new(500, 50)
.with_preserve_headers(true);
let chunks = splitter.split_text("# Title\n## Section\nContent...")?;Implementations§
Trait Implementations§
Source§impl TextSplitter for MarkdownTextSplitter
impl TextSplitter for MarkdownTextSplitter
Auto Trait Implementations§
impl Freeze for MarkdownTextSplitter
impl RefUnwindSafe for MarkdownTextSplitter
impl Send for MarkdownTextSplitter
impl Sync for MarkdownTextSplitter
impl Unpin for MarkdownTextSplitter
impl UnwindSafe for MarkdownTextSplitter
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> 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