mirror of
https://github.com/qurator-spk/dinglehopper.git
synced 2025-06-09 03:40:12 +02:00
ReadingOrder may also contain UnorderedGroupIndexed
This commit is contained in:
parent
1778b36a9a
commit
7fde00d911
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue