Skip to main content

Crate kopitiam_document

Crate kopitiam_document 

Source
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.
CodeBlock
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.
ConversionReport
Document
Figure
Heading
List
Metadata
Paragraph
Quote
No reconstruction pass produces this yet – block quotes currently fall through to Paragraph.
Table

Enums§

Block

Functions§

reconstruct
Turn a page’s raw text spans into the semantic Document AST: 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.
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.