Normalize wind speed units for German TTS

This commit is contained in:
Mikei386
2026-08-23 13:58:04 +02:00
parent c60031c957
commit 06e1a7029a
2 changed files with 17 additions and 0 deletions
@@ -268,6 +268,12 @@ def normalize_for_german_speech(text: str) -> str:
text,
flags=re.IGNORECASE,
)
text = re.sub(
r"(-?\d+(?:[,.]\d+)?)\s*km\s*(?:/\s*)?h\b",
r"\1 Kilometer pro Stunde",
text,
flags=re.IGNORECASE,
)
text = re.sub(r"(\d)\s*%", r"\1 Prozent", text)
return text