From d0f2827d66b8a127ecc18252f615301fee0cffdb Mon Sep 17 00:00:00 2001 From: dymik739 Date: Mon, 17 Apr 2023 22:11:49 +0300 Subject: [PATCH] transliteration-decoder: improve case-awareness to produce more precise translations --- modules/transliteration-decoder/index.py | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/transliteration-decoder/index.py b/modules/transliteration-decoder/index.py index 8b291aa..cd955c1 100644 --- a/modules/transliteration-decoder/index.py +++ b/modules/transliteration-decoder/index.py @@ -14,6 +14,7 @@ if self.MESSAGE['text'].split()[0] == "!decode" and (2 <= len(self.MESSAGE['text else: for i in models[chosen_model]: 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()) self.RESPONCE = f"Результат: {translated_t}"