from scripts.smart_translator import SmartTranslator
import sys

# Output encoding fix for terminal
import codecs
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())

print("🧠 USTA ASİSTAN BEYİN TESTİ BAŞLIYOR...\n")

t = SmartTranslator()

print("--------------------------------------------------")
print("SENARYO 1: Sözlük Testi (DeepL 'Seyahat' hatasına karşı)")
print("--------------------------------------------------")
input1 = "yürüyüş motoru basıncı düşük"
print(f"Girdi: '{input1}'")
print("... Düşünüyor (Sözlüğe bakıyor) ...")
try:
    output1 = t.correct_terminology(input1)
    print(f"SONUÇ: '{output1}'")
except Exception as e:
    print(f"HATA: {e}")

print("\n--------------------------------------------------")
print("SENARYO 2: Bozuk Yazım Testi (Kullanıcı Hatası)")
print("--------------------------------------------------")
input2 = "hyriloik pumpa valfi"
print(f"Girdi: '{input2}'")
print("... Düşünüyor (LLM ile düzeltiyor) ...")
try:
    output2 = t.correct_terminology(input2)
    print(f"SONUÇ: '{output2}'")
except Exception as e:
    print(f"HATA: {e}")

print("\n--------------------------------------------------")
print("Test Tamamlandı.")
