Commit Graph
11 Commits
Author SHA1 Message Date
Abimael MartellandClaude Opus 4.6 56cfd895b5 fix(tables): Prevent paragraph text from being falsely detected as tables
Add pairwise cross-row column alignment check to find_table_regions_strict().
Real tables have fixed column X positions that repeat across rows (score ~1.0),
while paragraph text has varying word positions (score ~0.3-0.4). Regions with
average pairwise alignment score < 0.5 are now rejected.

Also remove the num_cols >= 5 content-check bypass for BodyFont mode, requiring
body-font tables to always have ≥30% data-like cell content.

Fixes false table detection across 9+ PDFs including AI_Cultural_Collections
(-730 false lines), 131212888 (-740), Data-Processing-Agreement (-108),
CEP_DN_Interest_Rates (-93). No regressions on legitimate tables.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 15:10:10 -08:00
Abimael MartellandClaude Opus 4.6 9abb7a9c8b feat(tables): Add two-pass detection for body-font tables
Tables at body font size were invisible because detect_tables() gated on
font_size <= base * 0.90. Add a second pass with stricter structural
criteria (3+ columns, 70% alignment, 3+ rows with 3+ X-clusters) to
detect body-font tables without false-positiving on paragraphs. Also
raise the row limit from 30 to 50/100 to support large data tables.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 15:02:20 -08:00
Abimael MartellandClaude Opus 4.5 cd68515028 Add image and hyperlink extraction, improve line grouping
- Add ItemType enum to distinguish Text, Image, and Link items
- Extract XObject images from page resources with position/dimensions
- Parse Link annotations to extract hyperlinks with URLs
- Add include_images and include_links options to MarkdownOptions
- Fix line grouping to better detect new lines vs same-line items
- Add samples/ and scripts/ to .gitignore

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-11 08:31:20 -08:00
Abimael Martell 5afbb67b90 Fix list continuation, improve table detection, and add more font styling detection 2026-02-10 13:30:33 -08:00
Abimael Martell 3d6772fc20 improve spacing detection, and layout detection 2026-02-09 12:45:08 -08:00
Abimael Martell 0e5e978a33 improve table header detection 2026-02-09 10:13:16 -08:00
Abimael Martell 0f2f890a5c Table Improvements
1. Merge Continuation Rows (clean_table_cells)
2. Footnote Extraction (is_footnote_row)
3. Empty Row Removal
2026-02-08 22:04:25 -08:00
Abimael Martell d530f9c888 implement Subscript/Superscript detection 2026-02-07 22:27:54 -08:00
Abimael Martell 25ec142413 improve table detection 2026-02-07 19:50:53 -08:00
Abimael Martell 0acb3ecc8b format tables code 2026-02-07 19:40:28 -08:00
Abimael Martell 15981b7a15 add table detection 2026-02-07 19:39:42 -08:00