Skip to content

Commit

Permalink
🐛Better punctuation.
Browse files Browse the repository at this point in the history
Partially help #4
  • Loading branch information
sloganking committed Oct 25, 2023
1 parent 7e4d89c commit 807d6e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,15 @@ 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('.');
}
}
// if let Some(last_char) = transcription.chars().last() {
// if last_char != '.'
// && last_char != '?'
// && last_char != '!'
// && last_char != ','
// {
// transcription.push('.');
// }
// }
transcription.push(' ');

enigo.key_sequence(&transcription);
Expand Down
1 change: 1 addition & 0 deletions src/transcribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ pub mod trans {
let request = CreateTranscriptionRequestArgs::default()
.file(input_mp3)
.model("whisper-1")
.prompt("And now, a transcription from random language(s) that concludes with perfect punctuation: ")
.build()
.context("Failed to build transcription request.")?;

Expand Down

0 comments on commit 807d6e5

Please sign in to comment.