pub struct TableDetectionConfig {
pub enabled: bool,
pub horizontal_strategy: TableStrategy,
pub vertical_strategy: TableStrategy,
pub column_tolerance: f32,
pub row_tolerance: f32,
pub min_table_cells: usize,
pub min_table_columns: usize,
pub regular_row_ratio: f32,
pub max_table_columns: usize,
pub column_merge_threshold: f32,
pub v_split_gap: f32,
pub text_fallback: bool,
}Expand description
Configuration for spatial table detection.
Fields§
§enabled: boolWhether table detection is enabled.
horizontal_strategy: TableStrategyStrategy for horizontal boundary detection.
vertical_strategy: TableStrategyStrategy for vertical boundary detection.
column_tolerance: f32X-coordinate tolerance for column grouping.
row_tolerance: f32Y-coordinate tolerance for row grouping.
min_table_cells: usizeMinimum number of cells required for a valid table.
min_table_columns: usizeMinimum number of columns required for a valid table.
regular_row_ratio: f32Ratio of regular rows required for a valid table structure.
max_table_columns: usizeMaximum number of columns allowed before rejecting as false positive.
column_merge_threshold: f32Merge threshold for post-clustering column merge pass. Adjacent columns whose centers are within this distance are merged.
v_split_gap: f32Minimum gap between Y-range groups of vertical lines to trigger a cluster split. Default: 20.0. Use smaller values (e.g. 4.0) for strict mode, larger (e.g. 40.0) for relaxed mode where V-lines at mixed Y-ranges should stay together.
text_fallback: boolEnable text-only spatial detection as a fallback when no ruling lines are found.
When true and the page has no table-relevant paths (no ruling lines or
rectangles), the detector falls through to detect_tables_from_spans_column_aware
rather than returning an empty result. This is the right default for structured
output callers (to_markdown, to_html) that explicitly want tabular layout
and is also relied on by the public extract_tables API for line-less PDFs.
Set to false from callers that want the conservative
“no ruling lines → no tables” behaviour (e.g. plain-text extraction paths
that explicitly opt out — see extract_page_tables).
False-positive prose / TOC / underline tables that this default would
previously have surfaced are filtered post-detection by the
looks_like_prose_table shape gate and a ≥ 3-row evidence requirement
on text-only and h-rule paths.
Default: true.