+
Skip to content

Conversation

bsowell
Copy link
Contributor

@bsowell bsowell commented May 30, 2025

Pdfminer has an option to support vertical text in its layout analysis. This commit simply enables that option, which correctly extracts vertical text.

Pdfminer has an option to support vertical text in its layout analysis. This
commit simply enables that option, which correctly extracts vertical text.
@bsowell bsowell requested review from Copilot and karanataryn May 30, 2025 22:23
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables vertical text extraction support in pdfminer, ensuring that vertical text is correctly processed. Key changes include:

  • Enabling detect_vertical in LAParams for pdfminer extraction.
  • Adding a new unit test to verify vertical text extraction behavior.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
lib/sycamore/sycamore/transforms/text_extraction/pdf_miner.py Updated LAParams initialization to support vertical text grouping.
lib/sycamore/sycamore/tests/unit/transforms/test_detr_partitioner.py Added tests verifying that vertical text is extracted correctly for both "lines" and "boxes" extractors.


assert lines_text == objects_text

def test_pdfminer_vertical_text(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we split this into two tests? one for boxes and one for lines. It makes it easier to understand

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. All the other pdfminer tests have both in one method, but I will split this one if you think it's clearer.

@bsowell bsowell merged commit 701dfab into main Jun 2, 2025
12 of 15 checks passed
@bsowell bsowell deleted the ben/vertical_text branch June 2, 2025 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载