Keep German domain endings natural in TTS

This commit is contained in:
Mikei386
2026-08-23 13:33:20 +02:00
parent d726afff70
commit 4ae8ab948e
3 changed files with 8 additions and 3 deletions
+5 -1
View File
@@ -259,7 +259,11 @@ def normalize_for_german_speech(text: str) -> str:
r"\.(de|com|org|net|io|ai)\b",
lambda match: (
match.group(1).replace(".", " Punkt ")
+ " Punkt " + " ".join(match.group(2).upper())
+ " Punkt "
+ (
"de" if match.group(2).lower() == "de"
else " ".join(match.group(2).upper())
)
),
text,
flags=re.IGNORECASE,