Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle_adapter_text multiline #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions bin/handle_adapter_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down