For single-character text, set punctuation to all so the text is spoken.

This commit is contained in:
Nolan Darilek 2019-09-30 10:36:51 -05:00
parent 36745f9850
commit 7488dcbe3a
1 changed files with 7 additions and 0 deletions

View File

@ -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(())
}