Repository navigation
fix(pdf): normalize Arabic presentation forms (RTL phase 1) - #2539
Islam Al-Nashar (aslamalkarywk7) wants to merge 1 commit into
Conversation
|
@microsoft-github-policy-service agree |
|
Hi maintainers - the branch is now updated with main (clean merge, fix intact: PDF Arabic presentation-forms normalization plus 5 tests in test_pdf_rtl.py, all green locally). Could you please review when you get a chance? Related to #2336 (Phase 1). Thanks! |
92b307c to
4c11a0d
Compare
|
Hi maintainers — following up on this PR directly (my earlier status update was on #2336). The branch is on top of the current Verified locally on head
No regressions: the 5 new RTL tests are additive, and the existing PDF suite is unchanged. The workflow runs for this commit are held at Chien Yuan Chang (@chienyuanchang) — per your suggestion I kept the scope to presentation-form normalization only, and the reading-order / mixed-direction / table-association work is still open pending the redacted fixtures. I can share synthetic RTL fixtures (paragraphs, multi-column, mixed Arabic + numbers + URLs, legal identifiers) for a Phase 2 PR, or test against any redacted file the reporter shares — whichever is more useful. |
Related to #2336 (Phase 1 of the plan proposed there).
Some PDF producers emit Arabic Presentation Forms (U+FB50-U+FDFF, U+FE70-U+FEFF) instead of standard letters, which breaks downstream matching and LLM extraction. PdfConverter now normalizes exactly those two ranges to standard Unicode (NFKC per character, so ligatures expand too); everything else passes through byte-identical. Applied as a post-processing stage next to the existing numbering merge, so all extraction paths are covered.
Out of scope for this phase (stated openly): full BiDi reading-order reconstruction and RTL table column handling need the reporter redacted fixtures offered in the issue (or a new bidi dependency) - proposed as Phase 2 once fixtures land.
Verification on the current head (0 behind
main, 1 commit, 80 insertions across 2 files):mainbaselinetests/test_pdf.pytests/test_pdf_rtl.py(new)The new fixtures use explicit escapes so they are encoding-proof. The 5 RTL tests are additive; the existing PDF suite is unchanged.