Add test_extract_text_punctuation

This commit is contained in:
Jeremy Singer-Vine
2022-07-17 12:51:07 -04:00
parent 8687c8737f
commit 35fd4298bc
+9
View File
@@ -131,6 +131,15 @@ class Test(unittest.TestCase):
assert wordsB[2]["text"] == "al."
assert wordsC[2]["text"] == "al"
def test_extract_text_punctuation(self):
path = os.path.join(HERE, "pdfs/test-punkt.pdf")
with pdfplumber.open(path) as pdf:
text = pdf.pages[0].extract_text(
layout=True,
split_at_punctuation=True,
)
assert "https " in text
def test_text_flow(self):
path = os.path.join(HERE, "pdfs/federal-register-2020-17221.pdf")