Skip to content

Commit

Permalink
Merge pull request #58 from kba/unorderedgroupindexed
Browse files Browse the repository at this point in the history
ReadingOrder may also contain UnorderedGroupIndexed
  • Loading branch information
mikegerber authored May 18, 2021
2 parents 1778b36 + 7fde00d commit 0b9af3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qurator/dinglehopper/ocr_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ def extract_texts_from_reading_order_group(group, tree, nsmap, textequiv_level):

ro_children = filter(lambda child: "index" in child.attrib.keys(), ro_children)
ro_children = sorted(ro_children, key=lambda child: int(child.attrib["index"]))
elif ET.QName(group.tag).localname == "UnorderedGroup":
elif ET.QName(group.tag).localname in ["UnorderedGroup","UnorderedGroupIndexed"]:
ro_children = list(group)
else:
raise NotImplementedError


for ro_child in ro_children:
if ET.QName(ro_child.tag).localname in ["OrderedGroup", "OrderedGroupIndexed", "UnorderedGroup"]:
if ET.QName(ro_child.tag).localname in ["OrderedGroup", "OrderedGroupIndexed", "UnorderedGroup", "UnorderedGroupIndexed"]:
regions.extend(
extract_texts_from_reading_order_group(
ro_child, tree, nsmap, textequiv_level
Expand Down

0 comments on commit 0b9af3a

Please sign in to comment.