From 5ea6816c908ce90a77730925aeb72bd34c3c74fa Mon Sep 17 00:00:00 2001 From: powe97 <116031952+powe97@users.noreply.github.com> Date: Fri, 1 Mar 2024 17:21:45 -0500 Subject: [PATCH] Fix capitalization next to smart apostrophes (really?) --- transfer_scraper/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transfer_scraper/main.py b/transfer_scraper/main.py index 95a3d32..31acca1 100644 --- a/transfer_scraper/main.py +++ b/transfer_scraper/main.py @@ -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()