From 3d47524f2b697d35eacdf3f2c44d7a4be628a5d4 Mon Sep 17 00:00:00 2001 From: sloganking Date: Wed, 25 Oct 2023 19:14:22 -0400 Subject: [PATCH] add space only after Latin script punctuation. This is a hack for now, but is better than always adding a space for any language. I'll probably have a large language model figure out what punctuation to add later. --- src/main.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5d6447e..0b57d00 100644 --- a/src/main.rs +++ b/src/main.rs @@ -406,16 +406,12 @@ fn main() -> Result<(), Box> { } }; - // if let Some(last_char) = transcription.chars().last() { - // if last_char != '.' - // && last_char != '?' - // && last_char != '!' - // && last_char != ',' - // { - // transcription.push('.'); - // } - // } - transcription.push(' '); + if let Some(last_char) = transcription.chars().last() { + if ['.', '?', '!', ','].contains(&last_char) { + println!("adding space to end of transcription"); + transcription.push(' '); + } + } enigo.key_sequence(&transcription); } else {