← Whispering

fix: add terminal period after comma-joined list items

afd5b1a8e1f5cc7f520de780942fbbedc0d14d6a · Claude · Feb 10, 2026 21:53

Without a period, the last list item runs directly into the following
paragraph (e.g. "Hong Kong As for the percentage..."), producing text
that the G2P cannot phonemize.  Adding a period creates a proper
sentence boundary so the chunker splits cleanly.

https://claude.ai/code/session_01965m1v3f1cK6gDV1JHioA8

+6 −1 · 1 file changed

  • src/tts_provider.py +6 −1
diff --git a/src/tts_provider.py b/src/tts_provider.py
index d0af8a7..8649e50 100644
--- a/src/tts_provider.py
+++ b/src/tts_provider.py
@@ -674,7 +674,12 @@ class KokoroTTSProvider(BaseTTSProvider):
 
         def _flush_list():
             if list_buf:
-                merged.append(', '.join(list_buf))
+                joined = ', '.join(list_buf)
+                # End the list with a period so it forms a sentence
+                # boundary and doesn't run into the next paragraph.
+                if not re.search(r'[.!?]\s*$', joined):
+                    joined += '.'
+                merged.append(joined)
                 list_buf.clear()
 
         for line in lines: