Fix capital letters in compound names

This commit is contained in:
Théophile Bastian 2022-10-30 18:30:29 +01:00
parent 8d31594946
commit 6b38abe6f4

View file

@ -103,8 +103,9 @@ class Config:
# Normalize # Normalize
def normalize(x: str) -> str: def normalize(x: str) -> str:
x = x.strip() x = x.strip()
if " " in x: for sep in (" ", "-"):
return " ".join(map(normalize, x.split())) if sep in x:
return sep.join(map(normalize, x.split(sep)))
return x[0].upper() + x[1:].lower() return x[0].upper() + x[1:].lower()
for pers in raw_people: for pers in raw_people: