Commit 55a02ede authored by Merlijn Wajer's avatar Merlijn Wajer
Browse files

hocr/parse: make x_wconf optional

parent 6cdb14db
......@@ -183,7 +183,10 @@ def hocr_page_to_word_data(hocr_page, scaler=1):
box = BBOX_REGEX.search(word.attrib['title']).group(1).split()
box = [float(i) for i in box]
conf = int(X_WCONF_REGEX.search(word.attrib['title']).group(1).split()[0])
conf = None
m = X_WCONF_REGEX.search(word.attrib['title'])
if m:
conf = int(m.group(1).split()[0])
f_sizeraw = X_FSIZE_REGEX.search(word.attrib['title'])
if f_sizeraw:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment