Skip to content

fix: keep projected lines within ruled tables - #2

Closed
Chengyunlai wants to merge 2 commits into
codex/fix-separated-grid-componentsfrom
codex/fix-side-by-side-projected-lines-after-392
Closed

fix: keep projected lines within ruled tables#2
Chengyunlai wants to merge 2 commits into
codex/fix-separated-grid-componentsfrom
codex/fix-side-by-side-projected-lines-after-392

Conversation

@Chengyunlai

Copy link
Copy Markdown
Owner

Summary

  • pass detected ruled-table rectangles into projected-line construction
  • prevent same-y text from different table rectangles from becoming one projected line
  • keep each table’s projected lines contiguous so ruled-table consumption sees normal reading order
  • add a focused regression test covering both line separation and left-table-before-right-table ordering

Root cause

PR run-llama#392 separates the vector geometry for side-by-side ruled grids, but the projection stage still groups text from both rectangles into the same line. Each ruled candidate then sees text from the adjacent table as overhang and fallback detection merges the tables again.

This follow-up uses the already-detected table rectangles as structural grouping boundaries. It does not globally change y tolerance, so ordinary multi-column text behavior is unchanged.

Reproduction

On that document, the base of run-llama#392 produces one merged 6-column table. This follow-up produces two independent 3-column Markdown tables.

Validation

  • cargo fmt --all -- --check
  • cargo test -p liteparse projected_lines_do_not_span_independent_side_by_side_tables --lib -- --nocapture (1 passed)
  • cargo test -p liteparse --lib (295 passed)
  • full workspace release build through the repository Dockerfile
  • end-to-end parse of the public PDF with --format markdown --no-ocr

Dependency

This is intentionally a stacked draft based on codex/fix-separated-grid-components, the head branch of run-llama#392. It should be retargeted or rebased after run-llama#392 is resolved.

@Chengyunlai

Copy link
Copy Markdown
Owner Author

Superseded by the completed projection fix now included directly in run-llama#392 at 26b79a6. The published reproduction, A/B evidence, and expanded regression coverage are documented on the upstream PR and in run-llama#414.

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