Skip to content

Commit bd4cb28

Browse files
artizclaude
andcommitted
docs(COMPARING): PDF 4/14 via the docling-parse line sanitizer
multi_page is now byte-exact and the corpus is markedly closer. Update the PDF row (4/14, within-one 5/14) and describe the dp_lines sanitizer port that closed the text-run-boundary gap; note the remaining gaps (RTL justified double-spaces, table reading-order). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 41be9a1 commit bd4cb28

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

COMPARING.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ case — see the divergence table below.
177177
| **PPTX** | **7 / 7**| 7 / 7 |
178178
| **DOCX** | **25 / 26** | 25 / 26 |
179179
| **HTML** | **28 / 33** | 28 / 33 |
180-
| **PDF** | **3 / 14**| 4 / 14 |
180+
| **PDF** | **4 / 14**| 5 / 14 |
181181

182182
> † The pure-parse backends above are scored against **live** docling. **PDF** is
183183
> scored against the committed groundtruth corpus (`tests/data/pdf/groundtruth`)
@@ -193,15 +193,16 @@ port: image encoder + autoregressive OTSL structure decoder + cell-bbox decoder,
193193
exported to ONNX — see `tableformer.rs`, with cv2-exact `INTER_AREA`/`INTER_LINEAR`
194194
preprocessing in `resample.rs`), and **PaddleOCR** recognition for scanned /
195195
image-only pages — and regions are assembled in reading order into a
196-
`DoclingDocument`. Byte-exact today: `picture_classification`, `code_and_formula`,
197-
and `2305.03393v1-pg9` (**including its TableFormer-reconstructed table, cell for
198-
cell**). The rest are structurally correct but not byte-exact, and the ceiling is
199-
the **text extractor**: pdfium differs from docling's own `docling-parse` C++
200-
parser at text-run boundaries (inter-run spacing such as `LABEL :`, `<td>`, and
201-
fractions) and on right-to-left scripts (bidi reordering + Arabic lam-alef ligature
202-
decomposition) — differences a pdfium-based port cannot close without porting
203-
docling-parse itself. Closest non-exact: `right_to_left_01` (within one line),
204-
`amt_handbook_sample` (~8 lines).
196+
`DoclingDocument`. Text reconstruction ports **docling-parse's line sanitizer**
197+
(`dp_lines.rs`, from `cells.h`): the 3-pass corner-distance contraction with
198+
`merge_with` space insertion, `enforce_same_font`, ligature recomposition, and
199+
loose-box geometry — fed by pdfium glyphs. This closed the text-run-boundary gap
200+
that previously capped conformance (inter-run spacing like `LABEL :`, justified
201+
double-spacing, lam-alef ordering). Byte-exact today: `picture_classification`,
202+
`code_and_formula`, `2305.03393v1-pg9` (**including its TableFormer-reconstructed
203+
table, cell for cell**), and `multi_page`. The rest are structurally correct but
204+
not yet byte-exact — the remaining gaps are justified RTL double-spaces
205+
(`right_to_left_01`, within one line) and table reading-order on dense papers.
205206

206207
**DOCX** (`*.docx`) is a core port of `MsWordDocumentBackend` (`roxmltree` over
207208
the `ooxml` helper): paragraphs, headings (by style, incl. Title), **numbered

0 commit comments

Comments
 (0)