Normalize punctuation before German TTS
This commit is contained in:
@@ -110,6 +110,21 @@ class LanguageSegmentationTests(unittest.TestCase):
|
||||
self.assertIn("29 Kilometer pro Stunde", spoken)
|
||||
self.assertNotIn("km", spoken.lower())
|
||||
|
||||
def test_visual_punctuation_becomes_natural_pauses(self):
|
||||
spoken = gateway.clean_for_speech(
|
||||
"Status: stabil – keine Fehler; Docker-Container laufen."
|
||||
)
|
||||
self.assertEqual(
|
||||
spoken,
|
||||
"Status, stabil, keine Fehler, Docker Container laufen.",
|
||||
)
|
||||
self.assertNotRegex(spoken, r"[:;\-‐‑‒–—−]")
|
||||
|
||||
def test_punctuation_only_segments_are_never_synthesized(self):
|
||||
segments = gateway.prepare_segments("Status: – alles läuft.")
|
||||
self.assertTrue(segments)
|
||||
self.assertTrue(all(any(char.isalnum() for char in part) for _, part in segments))
|
||||
|
||||
def test_weather_summary_is_split_into_short_complete_chunks(self):
|
||||
text = (
|
||||
"Heute in Rastatt: teils sonnig, trocken, 10 bis 22 Grad. "
|
||||
|
||||
Reference in New Issue
Block a user