From 7488dcbe3aa28d53aada0ccbc732d0bda7747803 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Mon, 30 Sep 2019 10:36:51 -0500 Subject: [PATCH] For single-character text, set punctuation to all so the text is spoken. --- src/backends/speech_dispatcher.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backends/speech_dispatcher.rs b/src/backends/speech_dispatcher.rs index 06d7518..08b7b73 100644 --- a/src/backends/speech_dispatcher.rs +++ b/src/backends/speech_dispatcher.rs @@ -43,7 +43,14 @@ impl Backend for SpeechDispatcher { if interrupt { self.stop()?; } + let single_char = text.to_string().capacity() == 1; + if single_char { + self.0.set_punctuation(Punctuation::All); + } self.0.say(Priority::Important, text); + if single_char { + self.0.set_punctuation(Punctuation::None); + } Ok(()) }