Clean Notar -> NOTAR.

This commit is contained in:
John Wiseman 2019-12-27 13:53:16 -08:00
parent 9b6d402ba2
commit 7d983c6910

View File

@ -74,15 +74,22 @@ SUBSTITUTIONS = {
RE_SUBSTITUTIONS = [
# "AS.350-B-1" -> AS 350 B1"
[re.compile(r'\bAS.?350.?B.?1'), 'AS 350 B1'],
[re.compile(r'\bAS.?350.?B.?2'), 'AS 350 B2'],
[re.compile(r'\bAS.?350.?B.?3'), 'AS 350 B3'],
# "AS.350" -> "AS 350"
[re.compile(r'\bAS.?350'), 'AS 350'],
# "Notar" -> NOTAR
[re.compile(r'\bnotar\b', re.IGNORECASE), 'NOTAR']
]
def do_re_substitutions(s):
new_s = s
for regex, replacement in RE_SUBSTITUTIONS:
new_s = regex.sub(replacement, new_s)
# if s != new_s:
# print([s, new_s])
return new_s
def contains_upper_and_lower(s):