Skip to content

v0.8.5 — table extraction column fixes

Choose a tag to compare

@Detective-XH Detective-XH released this 27 Jun 19:43
· 44 commits to master since this release
v0.8.5
2f8935a

Fixed

  • Page.Tables() now recovers the trailing groups of space-separated thousands numbers that overflow a
    column's rule. In some statistical tables the figures are typeset on a slightly wider spacing than the
    ruled columns, so the last group of a number — the 315 in 66 315 — crossed the column's right rule
    and was dropped, truncating the rightmost numeric column on every row. Such a trailing digit group is
    now re-attached to the number it belongs to, recovering the full value. The recovery is deliberately
    narrow: only an all-digit group that straddles a numeric cell's right rule within the normal
    intra-number spacing is pulled back, so labels, units, footnote markers, and adjacent columns are never
    drawn across a boundary. The change is additive — Page.Words() and Page.Lines() are unaffected, and
    every regression-locked corpus fixture is byte-for-byte unchanged.

  • Page.Tables() no longer injects a phantom column into a banded table whose header background is
    drawn as two side-by-side filled rectangles. The seam between those two header rectangles was being
    mistaken for a column rule; where it fell inside a data column it split the value there — for example
    a space-separated thousands figure 5 417 724 was broken into 5 417 and 724, and the table
    reported one column too many. The header band is now reconciled so the spurious column is dropped and
    the value stays whole, with all header and data text preserved. This corrects single-row seam headers;
    multi-row seam headers (two stacked header bands) are handled by a later fix below, while a genuine
    grouped header carrying real per-column sub-labels is always left intact. Ruled tables and every
    regression-locked corpus fixture are byte-for-byte unchanged.

  • Page.Tables() no longer emits phantom empty columns where a drawn vertical rule cuts across a
    wide spanning cell. When a real rule splits a cell that actually encloses several columns, the
    lattice produced an all-empty "column" that the gutter filter could not drop — the spanning cell
    made it look too wide to be a gutter. Such a column is now recognised structurally (an empty
    column whose drawn span contains another column's position is a mis-split artifact) and removed.
    Only all-empty columns are ever dropped, so no extracted text is affected. For example a Serbian
    statistical-yearbook crop-production table reported 8 columns where the page has 6. Tables whose
    empty columns are genuine, and every regression-locked corpus fixture, are unchanged.

  • Page.Tables() now also removes phantom seam columns from banded tables whose header is drawn as
    TWO stacked bands (e.g. a title row over a year-label row), extending the single-row seam fix above.
    Each header row is checked independently and only a row carrying a decorative fill-rectangle seam
    (a boundary with no corresponding data column) is collapsed; a genuine grouped/spanning header whose
    sub-column edges align with real data columns is left intact, so no header or data text is lost. For
    example an exchange-rate table and several monthly-digest tables that reported one or two extra empty
    columns now match the printed column count. Regression-locked corpus fixtures are byte-for-byte
    unchanged.

Verify this release

Signed with an ED25519-SK FIDO2 hardware key:

256 SHA256:duCP4h22hb2oNAZMaFhUlpq0j8+qBbZuaXnS99yUhkY (ED25519-SK)

All of the maintainer's trusted keys are published on the GitHub account, so this recipe works regardless of which key signed the tag — nothing needs copying from these notes:

curl -s https://api.github.com/users/Detective-XH/ssh_signing_keys \
  | python3 -c "import json,sys; [print('*', k['key']) for k in json.load(sys.stdin)]" > allowed_signers
git -c gpg.ssh.allowedSignersFile=./allowed_signers tag -v v0.8.5
# expect: Good "git" signature for * with ED25519-SK key SHA256:duCP4h2...

Module integrity is independently guaranteed by the Go checksum database:

go mod download github.com/Detective-XH/gopdf@v0.8.5 && go mod verify