Expand description
Document AST and reconstruction: turns kopitiam_pdf::Page layout data
into a semantic Document (headings, paragraphs, lists, tables, figures),
plus a validation report auditing the conversion.
Structs§
- Citation
- A citation detected inside paragraph text, kept for provenance reporting. Citations are never extracted out of or altered within their surrounding paragraph text – this only records that one was seen, and where.
- Code
Block - No reconstruction pass produces this yet – code listings currently fall
through to
Paragraph. Kept in the AST so renderers and future reconstruction heuristics have a target to produce/consume. - Conversion
Report - Audits one PDF-to-Markdown conversion: how much of the extracted text survived into the rendered output, plus a tally of the structural blocks found, so every conversion is auditable rather than a silent best-effort guess.
- Document
- Figure
- Heading
- List
- Metadata
- Paragraph
- Quote
- No reconstruction pass produces this yet – block quotes currently fall
through to
Paragraph. - Table
Enums§
Functions§
- reconstruct
- Turn a page’s raw text spans into the semantic
DocumentAST: split each page into reading-order columns, group spans into lines, then classify each line (or run of lines) as a heading, list, table, figure caption, or paragraph. A final pass repairs the one join a per-page pipeline cannot see by construction: a paragraph split across a page break (seemerge_page_breaks/ kopitiam-d3n). - validate
- Compares what was extracted against what was rendered, and tallies the block types found, so every conversion produces an auditable report rather than a silent best-effort guess.