Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f115240

Browse files
committedFeb 8, 2025
Update check_chapters.py
1 parent 8bfb0cc commit f115240

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
 

‎scripts/check_chapters.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def fix_linebreaks_speech(s: str) -> str:
223223
return s
224224

225225
if settings["lang"] == "DE":
226-
s = re.sub(r" „([A-Z])", r"\n„\1", s)
226+
s = re.sub(r" „(\\emph|[A-Z])", r"\n„\1", s)
227227

228228
return s
229229

@@ -260,6 +260,9 @@ def fix_common_typos(s: str) -> str:
260260
s = s.replace("Wizengamot", "Zaubergamot")
261261
s = s.replace("S.P.H.E.W.", r"\SPHEW")
262262
s = s.replace("ut mir Leid", "ut mir leid")
263+
s = s.replace("Godric’s", "Godrics")
264+
s = s.replace("Godric's", "Godrics")
265+
s = re.sub("Mungo(|’|')s", "Mungo", s) # Mungo’s -> Mungo
263266
# s = s.replace("das einzige", "das Einzige")
264267
# Apostroph
265268
# "word's"

‎scripts/check_chapters_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
def test_fix_common_typos(lang: str) -> None:
2727
settings["lang"] = lang
2828
pairs = [
29-
("Test Mungo's King's Cross", "Test Mungo’s King’s Cross"),
29+
("Test King's Cross", "Test King’s Cross"),
3030
("Test", "Test"),
3131
]
3232
if lang == "EN":

0 commit comments

Comments
 (0)
Please sign in to comment.