Expand description
Spatial table detection from PDF text layout.
Implements table detection according to ISO 32000-1:2008 Section 5.2 (Coordinate Systems). Uses X and Y coordinate clustering to identify table structure in PDFs that lack explicit table markup in the structure tree.
Structs§
- Detected
Table - Backward compatibility: Indices of spans belonging to a table.
- Spatial
Table Detector - Backward compatibility: Table detector wrapper.
- Table
Detection Config - Configuration for spatial table detection.
Enums§
- Table
Strategy - Strategy for detecting table boundaries (v0.3.14).
Functions§
- consolidate_
adjacent_ table_ fragments - Consolidate vertically-adjacent tables that share an identical column structure into a single multi-row table.
- consolidate_
adjacent_ table_ fragments_ with_ tol - Like
consolidate_adjacent_table_fragmentsbut with a caller-chosen vertical merge tolerance. The default 3.0 pt tolerance assumes fragments abut (a ruling line between every row leaves ~0 gap). The H-rule-bounded detector, however, emits one fragment per rule-delimited band, so two bands of the SAME logical table are separated by a full inter-row pitch (rule stroke + leading) — often ~10-15 pt. A largery_tollets those bands rejoin. Safety rests on the unchanged column gating incan_merge_tables(equal col_count + X-start ≤ x_tol + width ≤ x_tol): two genuinely distinct tables sharing all three within one row-height are vanishingly rare, whereas bands of one ruled table match them exactly. - detect_
tables_ from_ spans - Detect tables from spatial layout of text spans.
- detect_
tables_ from_ spans_ column_ aware - Column-aware text-only table detection.
- detect_
tables_ with_ lines - Detect tables using vector lines and text spans (main entry point for hybrid detection).