fix(parser): PDF text via pdftable v0.4.0 (fixes reversed/garbled extraction)#51
Conversation
PDF section titles came out reversed and full of U+FFFD (e.g. 'Retrieval'->'laveirteR', plus 654 spurious sections) because text rows were sourced from ledongthuc/pdf, whose weak font-encoding + ordering mangles real design/academic PDFs. pdftable (our pdfplumber port) reads them correctly; v0.4.0 also fixes its word spacing (size-relative tolerance + explicit-space boundaries). Switch extractPDFRows to pdftable's Words() with those options, reusing the existing row bucketing / bold / letter-spacing-collapse logic. ledongthuc/pdf is now used ONLY for /Outlines and its failure is non-fatal (text no longer depends on it). Verified: the Vectorless whitepaper now parses to 6 clean sections with correct titles and zero replacement chars (was 654 reversed).
|
Warning Review limit reached
Next review available in: 21 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
pdftable's Words() mutates the same package-level state as OpenBytes and is not concurrent-safe; parallel ingest parses tripped the race detector. Hold pdftableOpenMu during row extraction, matching the existing guard on OpenBytes.
Sources PDF text rows from pdftable v0.4.0's
Words()instead ofledongthuc/pdf, which garbled real design/academic PDFs (reversed titles likelaveirteR, U+FFFD replacement chars, 654 spurious sections).extractPDFRowsnow uses pdftable with the v0.4.0 options (size-relative word tolerance + explicit-space boundaries), reusing the existing row/bold/letter-spacing logic.ledongthuc/pdfretained only for/Outlines; its failure is now non-fatal (text no longer depends on it).github.com/hallelx2/pdftableto v0.4.0.Verified: the Vectorless whitepaper parses to 6 clean sections with correct titles and zero
�(was 654 reversed). Parser tests green.