forked from kwaroran/Risuai
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patht.py
More file actions
29 lines (24 loc) · 682 Bytes
/
t.py
File metadata and controls
29 lines (24 loc) · 682 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
En2De = {
"hello": "Hallo",
"world": "Welt",
"python": "Python",
"is": "ist",
"a": "ein",
"programming": "Programmier",
"language": "Sprache",
"that": "das",
"lets": "lässt",
"you": "dich",
"work": "arbeiten",
"quickly": "schnell",
"and": "und",
"integrate": "integrieren",
"systems": "Systeme",
"more": "mehr",
"effectively": "effektiv",
}
def translate(text):
return " ".join(En2De.get(word, word) for word in text.split())
if __name__ == "__main__":
text = "hello world python is a programming language that lets you work quickly and integrate systems more effectively"
print(translate(text))