fix(sub-columns): convert relative word positions to absolute coords for split
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 24s
CI / test-go-edu-search (push) Successful in 27s
CI / test-python-klausur (push) Failing after 1m51s
CI / test-python-agent-core (push) Successful in 14s
CI / test-nodejs-website (push) Successful in 17s

Word 'left' values in ColumnGeometry.words are relative to the content
ROI (left_x), but geo.x is in absolute image coordinates. The split
position was computed from relative word positions and then compared
against absolute geo.x, resulting in negative widths and no splits on
real data. Pass left_x through to _detect_sub_columns to bridge the
two coordinate systems.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-02 19:16:13 +01:00
parent 6e1a349eed
commit 3904ddb493
3 changed files with 40 additions and 8 deletions

View File

@@ -700,7 +700,7 @@ async def detect_columns(session_id: str):
cached["_content_bounds"] = (left_x, right_x, top_y, bottom_y)
# Split sub-columns (e.g. page references) before classification
geometries = _detect_sub_columns(geometries, content_w)
geometries = _detect_sub_columns(geometries, content_w, left_x=left_x)
# Phase B: Content-based classification
regions = classify_column_types(geometries, content_w, top_y, w, h, bottom_y,