Skip to content

Commit

Permalink
PLGN-405-Reformatting to to black format
Browse files Browse the repository at this point in the history
  • Loading branch information
rbowden-r7 committed Oct 30, 2023
1 parent 5f58642 commit 2611af3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions plugins/extractit/icon_extractit/util/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ def extract_content_from_file(provided_file: bytes, provided_regex: str = "") ->


def extract_wrapped_words_from_pdf_page(
page: Page, provided_regex: str = "", tolerance: float = DEFAULT_PDF_WRAPPING_TOLERANCE,
page: Page,
provided_regex: str = "",
tolerance: float = DEFAULT_PDF_WRAPPING_TOLERANCE,
) -> List[str]:
"""
Extract wrapped words from a PDF page.
Expand All @@ -226,11 +228,11 @@ def extract_wrapped_words_from_pdf_page(
wrapped_words = []
max_x1 = max(character.get("x1") for character in page.chars)
extracted_words = page.extract_words(use_text_flow=True)

for index, word in enumerate(extracted_words):
if (max_x1 - word.get("x1")) < tolerance:
# if the current or next word in the list are valid matches then do not try and join then
if (provided_regex):
if provided_regex:
if (
not regex.findall(provided_regex, word.get("text", ""))
and (index + 1) < len(extracted_words)
Expand Down
1 change: 0 additions & 1 deletion plugins/extractit/icon_extractit/util/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class Regex:


class DateFormatStrings:

human_to_linux_mapping = {
"dd/mm/yyyy": "%d/%m/%Y",
"dd\\mm\\yyyy": "%d\\%m\\%Y",
Expand Down

0 comments on commit 2611af3

Please sign in to comment.