Skip to content

TablesInRuns: a caller who knows more can take the lines out first - #22

Merged
tannevaled merged 1 commit into
mainfrom
tables-over-the-runs-you-choose
Oct 12, 2026
Merged

tannevaled merged 1 commit into
mainfrom
tables-over-the-runs-you-choose

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

A numbered heading above a table leaves a gap after its number; the table below
it leaves that same gap empty on every row; so the two become one two-column
table
— and the real four-column table under it is lost, because the
heading's own text reaches across every one of its boundaries.

Measured on a 6-page technical paper. Page 2's four-column comparison came back
like this:

| 2. | Vue d’ensemble technique |
| --- | --- |
|  | HGX B300 GH200 NVL32 GB200 NVL36 GB300 NVL72 |
|  | Génération GPU Blackwell Ultra Hopper (GH200) Blackwell (B200) ... |

Nothing in the alignment says that line is a heading. Its size says so,
and what counts as a heading size is a property of the whole document — which
is go-pdfkit/document's business, not
this package's. So the detection is exposed over runs the caller chose:

tables := extract.TablesInRuns(runs, page, extract.TableOptions{})

The test asserts both readings of the same page: the swallowed two-column
one when asked about the page, and the four-column one when asked about the
runs below the heading. A test that only asserted the second would not show
what the first costs.

100% of statements, no uncovered blocks.

🤖 Generated with Claude Code

A numbered heading above a table leaves a gap after its number; the table
below it leaves that same gap empty on every row; so the two become ONE
two-column table -- and the real four-column table under it is lost, because
the heading's own text reaches across every one of its boundaries.

Measured on a 6-page technical paper: page 2's four-column comparison came
back as two columns, the first of them holding "2." and nothing else.

Nothing in the ALIGNMENT says that line is a heading. Its SIZE says so, and
what counts as a heading size is a property of the whole document -- which is
go-pdfkit/document's business, not this package's. So the detection is exposed
over runs the caller chose, and the caller who knows takes the line out and
asks again.

The test asserts BOTH readings of the same page: the swallowed two-column one
when asked about the page, and the four-column one when asked about the runs
below the heading. A test that only asserted the second would not show what
the first costs.

100% of statements, no uncovered blocks.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit d2961c7 into main Oct 12, 2026
1 check passed
@tannevaled
tannevaled deleted the tables-over-the-runs-you-choose branch October 12, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant