Data Structures =============== Core data structures for representing OCR results. Data Model ---------- The following diagram shows the relationships between data structures: .. mermaid:: graph LR %% Entities Page[Page] Block[Block] Line[Line] TextSpan[TextSpan] %% Relations Page -->|"blocks: List[Block]"| Block Block -->|"lines: List[Line]"| Line Line -->|"text_spans: List[TextSpan]"| TextSpan %% TextSpan fields TextSpan --> Tpoly["polygon: List[(x, y)]
≥ 4 points, clockwise"] TextSpan --> Tdet["detection_confidence: float (0–1)"] TextSpan --> Ttext["text: Optional[str]"] TextSpan --> Trec["recognition_confidence: Optional[float] (0–1)"] TextSpan --> Torder["order: Optional[int]
assigned after sorting"] %% Line fields Line --> LineOrder["order: Optional[int]
assigned after sorting"] %% Block fields Block --> BlockOrder["order: Optional[int]
assigned after sorting"] Block --> FlatInput["text_spans: List[TextSpan]
optional flat input"] Module Reference ---------------- .. automodule:: manuscript.data :members: :undoc-members: :show-inheritance: