diff --git a/calamari_ocr/ocr/text_processing/text_regularizer.py b/calamari_ocr/ocr/text_processing/text_regularizer.py index ea7f4e8b..7c623e70 100644 --- a/calamari_ocr/ocr/text_processing/text_regularizer.py +++ b/calamari_ocr/ocr/text_processing/text_regularizer.py @@ -72,7 +72,7 @@ def default_text_regularizer_params(params=TextProcessorParams(), groups=["simpl def replacement(old, new, regex=False): r = params.replacements.add() - r.old = old + r.old = "(?u)" + old[:-4] if regex and old.endswith("(?u)") else old r.new = new r.regex = regex