Skip to content

The grids the text lines up into: extract-tables and pdf-to-csv - #110

Merged
tannevaled merged 1 commit into
mainfrom
the-grids-the-text-lines-up-into
Oct 12, 2026
Merged

tannevaled merged 1 commit into
mainfrom
the-grids-the-text-lines-up-into

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

extract-tables and pdf-to-csv are claimed, through pdfops tables in
go-pdfkit/ops v0.17.0 over
go-pdfkit/extract v0.6.0.

covered       84
not covered   30
parity       73.7% (84/114), every claim verified

Both tools are one detector, and BentoPDF's pages are the same thing twice

extract-tables writes one file per table, pdf-to-csv writes all of them into
one. pdfops tables does both — with -to and without — so one verb answers
for both pages.

⛔ What bounds the claim, written into the table

Ruled lines are not read. That is the strategy PyMuPDF's find_tables uses
by default and falls back from, so a table held apart by rules rather than
by whitespace is not found. The claim is for the text strategy alone, and
that sentence is in parity/table.go, in extract's README under "What it
still gets wrong", and in ops's README beside the verb.

The detector was wrong four times, and no fixture could say so

It passed 100% of statements with no uncovered blocks and 15 of 15 mutations —
and then reported 588 tables in a 213-page document. Four defects, each
found by running it over a real document:

588 tables, 1841 rows   gaps the rows share
213 tables, 1631 rows   + boundaries the rows leave empty (a wrapped cell
                          leaves a line with no gaps of its own, and
                          intersecting with nothing ended the table there)
 83 tables,  268 rows    + a repeated one-character cell is a bullet, and a
                           bulleted list IS a two-column grid
 40 tables,  120 rows     + a column nothing was drawn in is not a column,
                            and a page number is not the last row

The forty are that document's Code/Intitulé pairs, one per job description.
A 3-page prose report in the same run reports none, which is the control: a
detector that cannot say no to a paragraph says yes to every page there is.

That is a measurement this repository cannot make for itself — there is no
corpus on this machine — so it is recorded where the code is, not here.

🤖 Generated with Claude Code

parity 73.7% (84/114), pasted from the tool's own output and not arithmetic.

Both tools are the same detector, which is an inference: a page holds text put
at places, and a table is what a reader sees when those places line up.
BentoPDF's own two pages are the same thing twice as well -- extract-tables
writes one file per table, pdf-to-csv writes all of them into one -- and
`pdfops tables` does both, with -to and without.

Written down in the table, because it bounds the claim: ruled lines are NOT
read. That is the strategy PyMuPDF's find_tables uses by default and falls back
FROM, so a table held apart by rules rather than by whitespace is not found.
The claim is for the text strategy alone.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit de1d99f into main Oct 12, 2026
9 checks passed
@tannevaled
tannevaled deleted the the-grids-the-text-lines-up-into branch October 12, 2026 06:24
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