/
sw_to_en.py
43 lines (43 loc) · 1.31 KB
/
sw_to_en.py
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
dictionary = {
"keywords": {
"tupu": "None",
"Kweli": "True",
"SiKweli": "False", # semantical correction
"vunja": "break",
"endelea": "continue",
"rudisha": "return",
"ingiza": "input",
"kama": "if",
"pia": "elif", # as long as it makes sense semantical translation does not matter
"ikiwa": "for",
"katiya": "range",
"imo": "in",
"wakati": "while",
"andika": "print",
"zaidi": "else",
"njia": "def", # njia is a more relevant keyword to functions/method
"pamoja": "with",
"darasa": "class",
"futa": "del", # futa is a lot simple to catch with and is commonly used than ondoa
"kutoka": "from",
"sio": "not",
"ni": "is",
"au": "or",
"na": "and",
"neno": "str",
"orodha": "list",
"kamusi": "dict",
"jaribu": "try",
"ila": "except", # ila is a lot simple to catch with and most relevant translation of except
},
"block_keywords": {
"kama": "if",
"pia": "elif", # reference line 10
"zaidi": "else",
"wakati": "while",
"ikiwa": "for",
"njia": "def", # reference line 17
"pamoja": "with",
"ila": "except", # reference line 30
},
}