Fix misplaced flags in re.sub() call

The 4th argument of re.sub() is maximum number of substitutions,
not flags.
This commit is contained in:
Jakub Wilk committed 2019-11-20 16:03:36 +01:00
1 parent 9f7c7a34db
commit 68729fb975
1 file changed
+1 -1
+1 -1
View File
@@ -155,7 +155,7 @@ def educateQuotes(text: str, language: str = 'en') -> str:
# Special case for decade abbreviations (the '80s):
if language.startswith('en'): # TODO similar cases in other languages?
text = re.sub(r"""'(?=\d{2}s)""", apostrophe, text, re.UNICODE)
text = re.sub(r"""'(?=\d{2}s)""", apostrophe, text, flags=re.UNICODE)
close_class = r"""[^\ \t\r\n\[\{\(\-]"""
dec_dashes = r"""–|—"""