diff --git a/bin/handle_adapter_text.py b/bin/handle_adapter_text.py index e0af818..e861612 100755 --- a/bin/handle_adapter_text.py +++ b/bin/handle_adapter_text.py @@ -54,12 +54,19 @@ def main() -> None: handled = False for line in stdout.splitlines(): line = line.strip() - if line: - write_event(Handled(text=line).event()) + if not line: + continue + if not line.endswith(('.', ',', ':', '?', ';')): + line = line + "." + if not handled: + text = line handled = True - break + else: + text = text + " " + line - if not handled: + if handled: + write_event(Handled(text=text).event()) + else: write_event(NotHandled().event()) break