transliteration-decoder: improve case-awareness to produce more precise translations

This commit is contained in:
dymik739 2023-04-17 22:11:49 +03:00
parent 0def45c6ce
commit d0f2827d66
1 changed files with 1 additions and 0 deletions

View File

@ -14,6 +14,7 @@ if self.MESSAGE['text'].split()[0] == "!decode" and (2 <= len(self.MESSAGE['text
else: else:
for i in models[chosen_model]: for i in models[chosen_model]:
translated_t = translated_t.replace(i[0], i[1]) translated_t = translated_t.replace(i[0], i[1])
translated_t = translated_t.replace(i[0].capitalize(), i[1].capitalize())
translated_t = translated_t.replace(i[0].upper(), i[1].upper()) translated_t = translated_t.replace(i[0].upper(), i[1].upper())
self.RESPONCE = f"Результат: {translated_t}" self.RESPONCE = f"Результат: {translated_t}"