Normalize wind speed units for German TTS
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user