From 786fcb9e139326200ae50b5be3730ddddc5b1bf9 Mon Sep 17 00:00:00 2001 From: Benjamin Kiessling Date: Wed, 24 Apr 2024 16:23:19 +0200 Subject: [PATCH] compatibility forced_align_overlay.py XML output with container classes --- kraken/contrib/forced_alignment_overlay.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kraken/contrib/forced_alignment_overlay.py b/kraken/contrib/forced_alignment_overlay.py index 7752a7c3c..23bae3fd2 100755 --- a/kraken/contrib/forced_alignment_overlay.py +++ b/kraken/contrib/forced_alignment_overlay.py @@ -50,7 +50,9 @@ def _repl_alto(fname, cuts): for chld in el: if chld.tag.endswith('Glyph'): el.remove(chld) - for char in line_cuts[idx:str_len]: + for char in zip(line_cuts.prediction[idx:str_len], + line_cuts.cuts[idx:str_len], + line_cuts.confidences[idx:str_len]): glyph = etree.SubElement(el, 'Glyph') glyph.set('ID', f'char_{char_idx}') char_idx += 1