-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapping.py
More file actions
86 lines (85 loc) · 1.23 KB
/
Mapping.py
File metadata and controls
86 lines (85 loc) · 1.23 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# creating lookup table
# 0-9 should return their value 0→0, 5→5, 9→9
# a should map to 10, b to 11, c to 12 etc. up to z→35
# Space should map to 36
MAPPING = {
"0": 0,
"1": 1,
"2": 2,
"3": 3,
"4": 4,
"5": 5,
"6": 6,
"7": 7,
"8": 8,
"9": 9,
"a": 10,
"b": 11,
"c": 12,
"d": 13,
"e": 14,
"f": 15,
"g": 16,
"h": 17,
"i": 18,
"j": 19,
"k": 20,
"l": 21,
"m": 22,
"n": 23,
"o": 24,
"p": 25,
"q": 26,
"r": 27,
"s": 28,
"t": 29,
"u": 30,
"v": 31,
"w": 32,
"x": 33,
"y": 34,
"z": 35,
" ": 36,
}
# creating inverse lookup table
# 0→0, 5→5, 9→9, 10→a, 11→b, 12→c etc. up to 35→z
# 36 should map to Space
INVERSE_MAPPING = {
0: "0",
1: "1",
2: "2",
3: "3",
4: "4",
5: "5",
6: "6",
7: "7",
8: "8",
9: "9",
10: "a",
11: "b",
12: "c",
13: "d",
14: "e",
15: "f",
16: "g",
17: "h",
18: "i",
19: "j",
20: "k",
21: "l",
22: "m",
23: "n",
24: "o",
25: "p",
26: "q",
27: "r",
28: "s",
29: "t",
30: "u",
31: "v",
32: "w",
33: "x",
34: "y",
35: "z",
36: " ",
}