diff --git a/idb/translator.py b/idb/translator.py index f3ba945..f316cd4 100644 --- a/idb/translator.py +++ b/idb/translator.py @@ -26,7 +26,15 @@ def translate(text): translation.append(chat_completion.choices[0].message.content) bufsize = 0 buf = [] - return "\n\n".join(translation) + replacements = ( + ('”', '"'), + ('“', '"'), + ("’", "'") + ) + translation = "\n\n".join(translation) + for r in replacements: + translation = translation.replace(r[0], r[1]) + return translation def num_tokens_from_string(string, encoding_name="o200k_base"):