Commit d148f4c
authored
@ (#55)
Drop rotated/vertical text runs from PDF extraction
Academic PDFs with a rotated left-margin stamp (arXiv:
"arXiv:1706.03762v7 [cs.CL] 2 Aug 2023") had that vertical text read in
reverse and it survived as junk headings/titles — the document title
became "3202 guA" (reversed "Aug 2023") and sections like "]LC.sc["
(reversed "[cs.CL]") and "7v26730.6071:viXra".
pdftable already classifies each word run: extractPDFRows now skips runs
that are not Upright or whose reading Direction is vertical ("ttb"/"btt")
via isRotatedRun. This removes margin stamps, page-edge watermarks, and
rotated figure labels — page furniture, never body prose — while keeping
upright LTR and RTL text untouched.
Verified on the arXiv "Attention Is All You Need" PDF: title now
"Attention Is All You Need", zero reversed-stamp sections, clean outline
(Abstract / 1 Introduction / 2 Background / 3 Model Architecture).
@1 parent 7fb8432 commit d148f4c
2 files changed
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1152 | 1152 | | |
1153 | 1153 | | |
1154 | 1154 | | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
1155 | 1166 | | |
1156 | 1167 | | |
1157 | 1168 | | |
| |||
1531 | 1542 | | |
1532 | 1543 | | |
1533 | 1544 | | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
1534 | 1563 | | |
1535 | 1564 | | |
1536 | 1565 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
0 commit comments