From 0334a358704d1f2f00a8197add96776521fd5608 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 12 Feb 2020 17:18:37 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Sort=20predictions=20in=20exactl?= =?UTF-8?q?y=20the=20same=20way,=20also=20when=20building=20the=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ocrd_calamari/recognize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocrd_calamari/recognize.py b/ocrd_calamari/recognize.py index 79cbd3b..8ae0a17 100644 --- a/ocrd_calamari/recognize.py +++ b/ocrd_calamari/recognize.py @@ -122,7 +122,7 @@ class CalamariRecognize(Processor): positions = _drop_double_spaces(positions) positions = list(positions) - line_text = ''.join(p.chars[0].char for p in positions) + line_text = ''.join(_sort_chars(p)[0].char for p in positions) if line_text != prediction.sentence: log.warning("Our own line text is not the same as Calamari's: '%s' != '%s'", line_text, prediction.sentence)