Skip to content

Commit

Permalink
Initial commit with main.py, LICENSE, and README
Browse files Browse the repository at this point in the history
  • Loading branch information
kurojs committed Mar 1, 2025
1 parent 21b6d34 commit b5981af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
TRANSLATION_LIMIT = 500

translator = Translator(to_lang="en")
translator_ja_en = Translator(from_lang="ja", to_lang="en")
translator_ja_es = Translator(from_lang="ja", to_lang="en")

def ollama_response(prompt):
try:
Expand Down Expand Up @@ -85,7 +85,7 @@ def main():
while True:
user_input = recognize_speech()
if user_input:
translation = translator_ja_en.translate(user_input)
translation = translator_ja_es.translate(user_input)
print(f"You said (translation): {translation}")

confirm = input("Type 'c' to confirm or 'r' to listen again: ").strip().lower()
Expand All @@ -94,7 +94,7 @@ def main():
if response:
response_parts = split_text(response, TRANSLATION_LIMIT)
for part in response_parts:
response_translation = translator_ja_en.translate(part)
response_translation = translator_ja_es.translate(part)
print(f"Answer (Japanese): {part}")
print(f"Answer (translation): {response_translation}")

Expand Down

0 comments on commit b5981af

Please sign in to comment.