From 7d983c691000213e30637d1d0cadd9bad299219b Mon Sep 17 00:00:00 2001 From: John Wiseman Date: Fri, 27 Dec 2019 13:53:16 -0800 Subject: [PATCH] Clean Notar -> NOTAR. --- cleanbasestation.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cleanbasestation.py b/cleanbasestation.py index 562ceaf..ca1b73e 100644 --- a/cleanbasestation.py +++ b/cleanbasestation.py @@ -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):