From b70682a6644f79990051b33d7b51c3420cd54720 Mon Sep 17 00:00:00 2001 From: dymik739 Date: Fri, 7 Apr 2023 00:00:04 +0300 Subject: [PATCH] initial commit --- main.py | 14 ++++++++++++++ translate_models.json | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 main.py create mode 100644 translate_models.json diff --git a/main.py b/main.py new file mode 100644 index 0000000..e277f07 --- /dev/null +++ b/main.py @@ -0,0 +1,14 @@ +import json + +models = json.loads(open("translate_models.json").read()) +chosen_model = input("Select model (" + ", ".join(list(models.keys())) + "): ") + +while True: + t = input("Enter text here: ") + + translated_t = t + for i in models[chosen_model]: + translated_t = translated_t.replace(i[0], i[1]) + translated_t = translated_t.replace(i[0].upper(), i[1].upper()) + + print(f"Result: {translated_t}\n") diff --git a/translate_models.json b/translate_models.json new file mode 100644 index 0000000..bb2ca30 --- /dev/null +++ b/translate_models.json @@ -0,0 +1,35 @@ +{ + "cz-ua": [ + ["šč", "щ"], + ["ja", "я"], + ["ju", "ю"], + ["ji", "ї"], + ["je", "є"], + ["f", "ф"], + ["b", "б"], + ["ž", "ж"], + ["q", "к"], + ["š", "ш"], + ["n", "н"], + ["p", "п"], + ["r", "р"], + ["s", "с"], + ["t", "т"], + ["h", "х"], + ["č", "ч"], + ["'", "ь"], + ["y", "и"], + ["z", "з"], + ["l", "л"], + ["k", "к"], + ["d", "д"], + ["u", "у"], + ["m", "м"], + ["v", "в"], + ["j", "й"], + ["s", "с"], + ["a", "а"], + ["i", "і"], + ["g", "г"] + ] +}