Skip to main content
Cutting a long, loosely structured text into passages that know their section path (see ChunkingConfig for the settings).

chunking.config

The chunking: section of ladygraph.yaml: how a long, loosely structured text (an OCR’d document, a converted PDF) is cut into passages.

ChunkingConfig

Repair

load_chunking_config

The chunking: section of a ladygraph.yaml, or None when the file has none.

chunking.flattener

From a long text to passages: parse, clean, chunk, check. chunk_document is pure; StructuredMarkdownFlattener plugs it into a markdown source.

ChunkOut

chunk_document

(chunks in document order, counters).

chunking.quality

Chunk quality checks. They flag a chunk for review; they never cut or change one.

balanced

failed

The checks a chunk fails, from “start”, “end”, “brackets”.

z_dips

vectors: unit-length vectors of every text block, in order; sizes: blocks per chunk.

chunking.structure

Structure: a rank-based heading stack turns a long text into chunks that each know their section path.

Chunk

build

clean

parse

stamp_words

ASCII words and dates in the header lines: signer names, codes, times.

chunking.tables

Tables as text a model can read: every cell keeps its column name, and the damage a page break leaves is repaired.

TableRepairer

Keeps the good headers it has seen, in document order. Construct with TableRepairer(cfg: ChunkingConfig).

fix_row

good

A header has names: its first cell is not empty or a bare number, and at most one cell is empty.

group

names

plain_rows

serialise