Fix capitalization next to smart apostrophes (really?)

This commit is contained in:
powe97 2024-03-01 17:21:45 -05:00
parent 6b5356c84f
commit 5ea6816c90
No known key found for this signature in database
GPG key ID: 7D1663B10978D1BA

View file

@ -24,7 +24,7 @@ def raise_(ex):
# Fix course titles accounting for Roman numerals up to X
def normalize_title(input):
s = " ".join(input.split())
s = re.sub(r"[A-Za-z]+('[A-Za-z]+)?", lambda m: m.group(0).capitalize(), s)
s = re.sub(r"[A-Za-z]+(['][A-Za-z]+)?", lambda m: m.group(0).capitalize(), s)
s = re.sub(r"\b(Viii|Vii|Vi|Iv|Ix|Iii|Ii)\b", lambda a: a.group(0).upper(), s)
return s.strip()