diff --git a/patacrep/authors.py b/patacrep/authors.py index 11d1df60..dadcc909 100644 --- a/patacrep/authors.py +++ b/patacrep/authors.py @@ -16,11 +16,11 @@ def compile_authwords(authwords): return { 'ignore': authwords.get('ignore', []), 'after': [ - re.compile(RE_AFTER.format(word), re.LOCALE) + re.compile(RE_AFTER.format(word)) for word in authwords.get('after') ], 'separators': [ - re.compile(RE_SEPARATOR.format(word), re.LOCALE) + re.compile(RE_SEPARATOR.format(word)) for word in ([" %s" % word for word in authwords['separators']] + [',', ';']) ], } diff --git a/patacrep/index.py b/patacrep/index.py index d572f872..e520e713 100644 --- a/patacrep/index.py +++ b/patacrep/index.py @@ -16,8 +16,8 @@ from patacrep.latex import tex2plain EOL = "\n" # Pattern set to ignore latex command in title prefix -KEYWORD_PATTERN = re.compile(r"^%(\w+)\s?(.*)$", re.LOCALE) -FIRST_LETTER_PATTERN = re.compile(r"^(?:\{?\\\w+\}?)*[^\w]*(\w)", re.LOCALE) +KEYWORD_PATTERN = re.compile(r"^%(\w+)\s?(.*)$") +FIRST_LETTER_PATTERN = re.compile(r"^(?:\{?\\\w+\}?)*[^\w]*(\w)") def process_sxd(filename): """Parse sxd file. @@ -90,8 +90,7 @@ class Index: if 'prefix' in self.keywords: for prefix in self.keywords['prefix']: self.prefix_patterns.append(re.compile( - r"^({prefix})(\b|\\)(\s*.*)$".format(prefix=prefix), - re.LOCALE + r"^({prefix})(\b|\\)(\s*.*)$".format(prefix=prefix) )) if self.indextype == "AUTHOR": diff --git a/patacrep/songs/__init__.py b/patacrep/songs/__init__.py index b1d80f5d..c58aaae9 100644 --- a/patacrep/songs/__init__.py +++ b/patacrep/songs/__init__.py @@ -294,7 +294,7 @@ def unprefixed_title(title, prefixes): """Remove the first prefix of the list in the beginning of title (if any). """ for prefix in prefixes: - match = re.compile(r"^(%s)\b\s*(.*)$" % prefix, re.LOCALE).match(title) + match = re.compile(r"^(%s)\b\s*(.*)$" % prefix).match(title) if match: return match.group(2) return title