Skip to content

Commit

Permalink
page_validator: fix conditions for indexed group
Browse files Browse the repository at this point in the history
  • Loading branch information
bertsky committed May 10, 2020
1 parent 09f3994 commit 8ca626f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ocrd_validators/ocrd_validators/page_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ def validate_consistency(node, page_textequiv_consistency, page_textequiv_strate
children = getattr(node, getter)()
if (getter == 'get_TextRegion' and children and
all(child.id in readingOrder for child in children) and
isinstance(readingOrder[children[0].id], (OrderedGroupType, OrderedGroupIndexedType))):
isinstance(readingOrder[children[0].id].parent_object_,
(OrderedGroupType, OrderedGroupIndexedType))):
children = sorted(children, key=lambda child:
readingOrder[child.id].index)
elif ((getter == 'get_TextLine' and textLineOrder == _ORDER[0][1]) or
Expand Down

0 comments on commit 8ca626f

Please sign in to comment.