Skip to content

Commit

Permalink
fix failing test: let regions_overlap return when none of the conditi…
Browse files Browse the repository at this point in the history
…ons are met
  • Loading branch information
brambg committed Mar 18, 2024
1 parent 477b9c8 commit ba9de4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions pagexml/helper/pagexml_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ def regions_overlap(region1: pdm.PageXMLDoc, region2: pdm.PageXMLDoc,
if v_overlap / height2 > threshold:
if h_overlap / width2 > threshold:
return True
else:
return False
return False


def sort_regions_in_reading_order(doc: pdm.PageXMLDoc) -> List[pdm.PageXMLTextRegion]:
Expand Down
2 changes: 1 addition & 1 deletion tests/helper-pagexml_helper_test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import unittest
from typing import List, Tuple

from pagexml.parser import parse_pagexml_file
import pagexml.helper.pagexml_helper as helper
import pagexml.model.physical_document_model as pdm
from pagexml.parser import parse_pagexml_file


def make_region(points: List[Tuple[int, int]], doc_id: str = 'doc') -> pdm.PageXMLTextRegion:
Expand Down

0 comments on commit ba9de4e

Please sign in to comment.