Skip to content

Commit

Permalink
add space only after Latin script punctuation.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sloganking committed Oct 25, 2023
1 parent 807d6e5 commit 3d47524
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,16 +406,12 @@ fn main() -> Result<(), Box<dyn Error>> {
}
};

// 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 {
Expand Down

0 comments on commit 3d47524

Please sign in to comment.