1
0
Fork 0
mirror of https://github.com/qurator-spk/dinglehopper.git synced 2025-06-09 20:00:01 +02:00

🐛 dinglehopper: Do try to get text when no TextEquivs exist

This commit is contained in:
Gerber, Mike 2020-10-21 17:59:44 +02:00
parent f14ae46870
commit e4e2777cb7

View file

@ -185,6 +185,10 @@ class ExtractedText:
def get_textequiv_unicode(s): def get_textequiv_unicode(s):
"""Get the TextEquiv/Unicode text of the given PAGE text element""" """Get the TextEquiv/Unicode text of the given PAGE text element"""
textequivs = s.findall('./page:TextEquiv', namespaces=nsmap) textequivs = s.findall('./page:TextEquiv', namespaces=nsmap)
if not textequivs:
return None
def get_index(te): def get_index(te):
index = te.attrib.get('index') index = te.attrib.get('index')
try: try: