From 103b1d76716cc722e099611104d7d48d416575e2 Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Wed, 6 Nov 2019 00:46:40 +0100 Subject: [PATCH] remove existing annotation below the line level to avoid inconsistency --- ocrd_calamari/recognize.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ocrd_calamari/recognize.py b/ocrd_calamari/recognize.py index 969de21..92aa5a4 100644 --- a/ocrd_calamari/recognize.py +++ b/ocrd_calamari/recognize.py @@ -77,7 +77,13 @@ class CalamariRecognize(Processor): line_text = prediction.sentence line_conf = prediction.avg_char_probability + if line.get_TextEquiv(): + log.warning("Line '%s' already contained text results", line.id) line.set_TextEquiv([TextEquivType(Unicode=line_text, conf=line_conf)]) + + if line.get_Word(): + log.warning("Line '%s' already contained word segmentation", line.id) + line.set_Word([]) _page_update_higher_textequiv_levels('line', pcgts)