Skip to content

Side-by-side ruled tables still share projected text lines #414

Description

@Chengyunlai

Summary

After side-by-side ruled grids are identified as independent geometry
components, same-y text from adjacent table rectangles can still be grouped
into shared projected lines. Each ruled candidate then sees text from the
other table as overhang, is rejected, and fallback emits a merged table.

The completed fix is now included directly in #392 at 26b79a6.

Public reproduction

The PDF is a self-authored, synthetic one-page Word-to-PDF document. It has no
customer, personal, credential, internal-project, or business-specific data.

Command

lit parse /input.pdf \
  --no-ocr \
  --format markdown \
  --output /results/output.md \
  --quiet

Observed pipeline before the fix

At the previous #392 head (9d740a4), geometry is already separate but text
projection is not:

two independent vector grids
-> two ruled components
-> shared cross-table projected text lines
-> ruled candidates rejected for adjacent-table overhang
-> fallback emits one merged 6-column table

Expected output

## Release channels

| Channel | Status | Owner |
|---|---|---|
| Stable | Ready | Team A |
| Beta | Testing | Team B |
| Nightly | Active | Team C |

## Support windows

| Region | Window | Contact |
|---|---|---|
| East | Morning | Desk 1 |
| West | Afternoon | Desk 2 |
| Central | Evening | Desk 3 |

Fix in #392

The updated projection path receives the detected ruled-table rectangles and
uses them as structural boundaries:

  • same-y items owned by different table rectangles cannot become one line;
  • nearby labels can belong to exactly one table;
  • page-spanning labels remain unowned;
  • table-owned lines are ordered left-to-right within a side-by-side band and
    top-to-bottom across bands;
  • ordinary non-table line grouping keeps its existing y tolerance.

A/B result

Version Geometry Public Markdown
main@2fd644a one merged component one merged 7-column table
previous #392 head 9d740a4 two components one merged 6-column fallback table
current #392 head 26b79a6 two components two headings and two independent 3-column tables

Regression coverage

#392 now covers the published side-by-side shape plus:

  • one wide ruled table;
  • vertically stacked ruled tables;
  • ordinary two-column prose;
  • one spanning heading above two tables;
  • multiple table bands and a non-transitive three-table overlap.

This issue should close when #392 is merged. The separate same-y Markdown
heading-continuation boundary found during adjacent testing is tracked in
#418.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions