-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78fd0a7
commit 0000792
Showing
7 changed files
with
189 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import pytest | ||
|
||
from marker.processors.ignoretext import IgnoreTextProcessor | ||
from marker.schema import BlockTypes | ||
|
||
|
||
@pytest.mark.filename("bio_pdf.pdf") | ||
@pytest.mark.config({"page_range": list(range(6))}) | ||
@pytest.mark.skip(reason="Need to wait for layout model to stabilize before activating.") | ||
def test_ignoretext_processor(pdf_document): | ||
processor = IgnoreTextProcessor() | ||
processor(pdf_document) | ||
|
||
page0_header = pdf_document.pages[0].contained_blocks(pdf_document, [BlockTypes.Text])[0] | ||
assert "bioRxiv" in page0_header.raw_text(pdf_document) | ||
breakpoint() | ||
|
||
first_span = page0_header.contained_blocks(pdf_document, [BlockTypes.Span])[0] | ||
assert first_span.ignore_for_output is True |