Skip to content

Commit

Permalink
compatibility forced_align_overlay.py XML output with container classes
Browse files Browse the repository at this point in the history
  • Loading branch information
mittagessen committed Apr 24, 2024
1 parent 3a8aba1 commit 786fcb9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kraken/contrib/forced_alignment_overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 786fcb9

Please sign in to comment.