1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Structure-aware document processing for intelligent chunking.
//!
//! This module provides detection and chunking of document structures like tables,
//! code blocks, lists, and sections. It ensures that semantic units are preserved
//! during chunking, with features like table header propagation.
//!
//! # Architecture
//!
//! ```text
//! Raw Text ──► Detector ──► StructuredDocument ──► Chunker ──► StructuredChunks
//! │
//! ├── Tables (with headers/rows)
//! ├── Code blocks (with language)
//! ├── Lists (ordered/unordered)
//! ├── Headings (h1-h6)
//! └── Paragraphs
//! ```
//!
//! # Example
//!
//! ```ignore
//! use memvid_core::structure::{detect_structure, StructuralChunker, ChunkingOptions};
//!
//! let text = "# Report\n\n| Name | Value |\n|---|---|\n| A | 1 |\n| B | 2 |";
//! let doc = detect_structure(text);
//!
//! let chunker = StructuralChunker::new(ChunkingOptions::default());
//! let result = chunker.chunk(&doc);
//!
//! for chunk in result.chunks {
//! println!("{}: {}", chunk.chunk_type, chunk.text);
//! }
//! ```
pub use ;
pub use ;
// Re-export types for convenience
pub use crate;