commit b70682a6644f79990051b33d7b51c3420cd54720 Author: dymik739 Date: Fri Apr 7 00:00:04 2023 +0300 initial commit 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", "г"] + ] +}