diff --git a/modules/transliteration-decoder/index.py b/modules/transliteration-decoder/index.py index b04c063..ea9b74f 100644 --- a/modules/transliteration-decoder/index.py +++ b/modules/transliteration-decoder/index.py @@ -4,8 +4,14 @@ command_length = len(command) def escaped_string(unescaped_string): result_string = str(unescaped_string) - for i in ["<", ">"]: - result_string = result_string.replace(i, f"\\{i}") + escaping_rules = { + "<": "<", + ">": ">", + '"': """ + } + + for i in escaping_rules.items(): + result_string = result_string.replace(i[0], i[1]) return result_string @@ -31,7 +37,7 @@ if (command[0] in self.aliases) and (1 <= command_length <= 3): f"{', '.join(list(models.keys()))}" else: for i in models[chosen_model]: - decoded_text = decoded_text.replace(i[0], i[1]) + decoded_text = decoded_text.replace(i[0].lower(), i[1].lower()) decoded_text = decoded_text.replace(i[0].capitalize(), i[1].capitalize()) decoded_text = decoded_text.replace(i[0].upper(), i[1].upper()) diff --git a/modules/transliteration-decoder/translate_models.json b/modules/transliteration-decoder/translate_models.json index d931d09..3bfd1fc 100644 --- a/modules/transliteration-decoder/translate_models.json +++ b/modules/transliteration-decoder/translate_models.json @@ -75,5 +75,57 @@ ["$", ";"], ["^", ":"], ["&", "?"] + ], + "en-men": [ + ["a", "4"], + ["b", "8"], + ["c", "("], + ["d", "|)"], + ["e", "3"], + ["f", "|="], + ["g", "6"], + ["h", "#"], + ["i", "!"], + ["j", "|_"], + ["k", "|<"], + ["l", "1"], + ["m", "//N"], + ["o", "0"], + ["p", "|D"], + ["q", "(,)"], + ["r", "|2"], + ["s", "5"], + ["t", "7"], + ["u", "|_|"], + ["w", "//"], + ["v", "/"], + ["x", "><"], + ["y", "`/"] + ], + "men-en": [ + ["4", "a"], + ["8", "b"], + ["(,)", "q"], + ["(", "c"], + ["|)", "d"], + ["3", "e"], + ["|=", "f"], + ["6", "g"], + ["#", "h"], + ["!", "i"], + ["|_|", "u"], + ["|_", "j"], + ["|<", "k"], + ["1", "l"], + ["//N", "m"], + ["0", "o"], + ["|D", "p"], + ["|2", "r"], + ["5", "s"], + ["7", "t"], + ["//", "w"], + ["`/", "y"], + ["/", "v"], + ["><", "x"] ] }