Keep German domain endings natural in TTS
This commit is contained in:
1 parent
d726afff70
commit
4ae8ab948e
3 files changed
+8
-3
No files matched your search
@@ -89,7 +89,7 @@ class LanguageSegmentationTests(unittest.TestCase):
|
||||
self.assertIn("Höchstwert 22 Grad, Tiefstwert 10 Grad", spoken)
|
||||
self.assertIn("0 Prozent Regen", spoken)
|
||||
self.assertIn("wetter Punkt C O M", spoken)
|
||||
self.assertIn("wetteronline Punkt D E", spoken)
|
||||
self.assertIn("wetteronline Punkt de", spoken)
|
||||
|
||||
def test_full_date_and_raw_url_are_normalized(self):
|
||||
spoken = gateway.clean_for_speech(
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user