mirror of
https://github.com/quatalog/quatalog.git
synced 2024-11-22 23:02:57 +00:00
Fix capitalization next to smart apostrophes (really?)
This commit is contained in:
parent
6b5356c84f
commit
5ea6816c90
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue