initial commit

This commit is contained in:
dymik739 2023-04-07 00:00:04 +03:00
commit b70682a664
2 changed files with 49 additions and 0 deletions

14
main.py Normal file
View File

@ -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")

35
translate_models.json Normal file
View File

@ -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", "г"]
]
}