Skip to content

armgit / Handy

Public Imported from GitHub
0

A free, open source, and extensible speech-to-text application that works completely offline.

Fixed post-processing for chinese (#628)

CJ Paisc45df96065c0
diff --git a/src-tauri/src/actions.rs b/src-tauri/src/actions.rs
index 5eb5c0ee..6dfa52d3 100644
--- a/src-tauri/src/actions.rs
+++ b/src-tauri/src/actions.rs
@@ -340,15 +340,16 @@ impl ShortcutAction for TranscribeAction {
if let Some(converted_text) =
maybe_convert_chinese_variant(&settings, &transcription).await
{
- final_text = converted_text.clone();
- post_processed_text = Some(converted_text);
+ final_text = converted_text;
}
+
// Then apply regular post-processing if enabled
- else if let Some(processed_text) =
- maybe_post_process_transcription(&settings, &transcription).await
+ // Uses final_text which may already have Chinese conversion applied
+ if let Some(processed_text) =
+ maybe_post_process_transcription(&settings, &final_text).await
{
- final_text = processed_text.clone();
- post_processed_text = Some(processed_text);
+ post_processed_text = Some(processed_text.clone());
+ final_text = processed_text;
// Get the prompt that was used
if let Some(prompt_id) = &settings.post_process_selected_prompt_id {
@@ -360,6 +361,9 @@ impl ShortcutAction for TranscribeAction {
post_process_prompt = Some(prompt.prompt.clone());
}
}
+ } else if final_text != transcription {
+ // Chinese conversion was applied but no LLM post-processing
+ post_processed_text = Some(final_text.clone());
}
// Save to history with post-processed text and prompt