Calamari-OCR / calamari

Line based ATR Engine based on OCRopy
Apache License 2.0
1.04k stars 209 forks source link

Move global flags to the start of regular expressions #349

Closed mikegerber closed 10 months ago

mikegerber commented 10 months ago

Fix regex replacements for models where global flags were put at the end of the pattern strings. These patterns are invalid as of Python 3.11. This only applies to models which were created with earlier Calamari 1.x versions that had this kind of regular expression patterns in their defaults.

This PR also reverts @andbue's previous commit which only applied to the default text regularizer parameters - which do not have this issue anymore. @andbue: Hope this is OK for you!

Fixes #348.