-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.py
354 lines (346 loc) · 13.1 KB
/
constants.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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
from find_replace import AhoCorasickReplace
days = {
'MON': 'MONDAY',
'MONDAY': 'MONDAY',
'ISN': 'MONDAY',
'SEN': 'MONDAY',
'ISNIN': 'MONDAY',
'SENIN': 'MONDAY',
'ISNEN': 'MONDAY',
'SENEN': 'MONDAY',
'TUES': 'TUESDAY',
'TUE': 'TUESDAY',
'TUESDAY': 'TUESDAY',
'SEL': 'TUESDAY',
'SELASA': 'TUESDAY',
'WED': 'WEDNESDAY',
'WEDNESDAY': 'WEDNESDAY',
'RAB': 'WEDNESDAY',
'RABU': 'WEDNESDAY',
'THU': 'THURSDAY',
'THUR': 'THURSDAY',
'THURS': 'THURSDAY',
'THURSDAY': 'THURSDAY',
'KA': 'THURSDAY',
'KHA': 'THURSDAY',
'KAM': 'THURSDAY',
'KHAM': 'THURSDAY',
'KAMIS': 'THURSDAY',
'KHAMIS': 'THURSDAY',
'FRI': 'FRIDAY',
'FRIDAY': 'FRIDAY',
'FRIYAY': 'FRIDAY',
'JUM': 'FRIDAY',
'JUMAT': 'FRIDAY',
'JUMMT': 'FRIDAY',
'JUMAAT': 'FRIDAY',
'JUMMAT': 'FRIDAY',
'SAT': 'SATURDAY',
'SATURDAY': 'SATURDAY',
'SAB': 'SATURDAY',
'SABTU': 'SATURDAY',
'SUN': 'SUNDAY',
'SUNDAY': 'SUNDAY',
'AHD': 'SUNDAY',
'AHAD': 'SUNDAY',
'MIN': 'SUNDAY',
'MINGGU': 'SUNDAY',
}
months = {
'DJANUARI': 'JANUARY',
'DJANUARY': 'JANUARY',
'DJAN': 'JANUARY',
'JANUARI': 'JANUARY',
'JANUARY': 'JANUARY',
'JAN': 'JANUARY',
'FEBRUARI': 'FEBRUARY',
'FEBRUARY': 'FEBRUARY',
'FEB': 'FEBRUARY',
'PEBRUARI': 'FEBRUARY',
'PEBRUARY': 'FEBRUARY',
'PEB': 'FEBRUARY',
'MAC': 'MARCH',
'MARCH': 'MARCH',
'MARET': 'MARCH',
'MAR': 'MARCH',
'MRT': 'MARCH',
'APRIL': 'APRIL',
'APR': 'APRIL',
'MEI': 'MAY',
'MAI': 'MAY',
'MAY': 'MAY',
'JUN': 'JUNE',
'JUNE': 'JUNE',
'JUNI': 'JUNE',
'DJUNI': 'JUNE',
'DJUN': 'JUNE',
'JULAI': 'JULY',
'JULY': 'JULY',
'JUL': 'JULY',
'JULI': 'JULY',
'DJUL': 'JULY',
'DJULI': 'JULY',
'OG': 'AUGUST',
'OGOS': 'AUGUST',
'AUG': 'AUGUST',
'AUGUST': 'AUGUST',
'AG': 'AUGUST',
'AGUSTUS': 'AUGUST',
'AGT': 'AUGUST',
'AGTUSTUS': 'AUGUST',
'SEP': 'SEPTEMBER',
'SEPT': 'SEPTEMBER',
'SEPTEMBER': 'SEPTEMBER',
'OCT': 'OCTOBER',
'OCTOBER': 'OCTOBER',
'OKT': 'OCTOBER',
'OKTOBER': 'OCTOBER',
'NOV': 'NOVEMBER',
'NOP': 'NOVEMBER',
'NOVEMBER': 'NOVEMBER',
'NOPEMBER': 'NOVEMBER',
'DIS': 'DECEMBER',
'DES': 'DECEMBER',
'DIC': 'DECEMBER',
'DEC': 'DECEMBER',
'DISEMBER': 'DECEMBER',
'DESEMBER': 'DECEMBER',
'DICEMBER': 'DECEMBER',
'DECEMBER': 'DECEMBER',
}
timezones = {
'ACDT': 'Australian Central Daylight Savings Time; UTC+10:30',
'ACST': 'Australian Central Standard Time; UTC+09:30',
'ACT': 'Acre Time; UTC-05',
'ACT': 'ASEAN Common Time; UTC+06:30 - UTC+09',
'ACWST': 'Australian Central Western Standard Time (unofficial); UTC+08:45',
'ADT': 'Atlantic Daylight Time; UTC-03',
'AEDT': 'Australian Eastern Daylight Savings Time; UTC+11',
'AEST': 'Australian Eastern Standard Time; UTC+10',
'AFT': 'Afghanistan Time; UTC+04:30',
'AKDT': 'Alaska Daylight Time; UTC-08',
'AKST': 'Alaska Standard Time; UTC-09',
'AMST': 'Amazon Summer Time (Brazil)[1]; UTC-03',
'AMT': 'Amazon Time (Brazil)[2]; UTC-04',
'AMT': 'Armenia Time; UTC+04',
'ART': 'Argentina Time; UTC-03',
'AST': 'Arabia Standard Time; UTC+03',
'AST': 'Atlantic Standard Time; UTC-04',
'AWST': 'Australian Western Standard Time; UTC+08',
'AZOST': 'Azores Summer Time; UTC+00',
'AZOT': 'Azores Standard Time; UTC-01',
'AZT': 'Azerbaijan Time; UTC+04',
'BDT': 'Brunei Time; UTC+08',
'BIOT': 'British Indian Ocean Time; UTC+06',
'BIT': 'Baker Island Time; UTC-12',
'BOT': 'Bolivia Time; UTC-04',
'BRST': 'Brasilia Summer Time; UTC-02',
'BRT': 'Brasilia Time; UTC-03',
'BST': 'Bangladesh Standard Time; UTC+06',
'BST': 'Bougainville Standard Time[3]; UTC+11',
'BST': 'British Summer Time (British Standard Time from Feb 1968 to Oct 1971); UTC+01',
'BTT': 'Bhutan Time; UTC+06',
'CAT': 'Central Africa Time; UTC+02',
'CCT': 'Cocos Islands Time; UTC+06:30',
'CDT': 'Central Daylight Time (North America); UTC-05',
'CDT': 'Cuba Daylight Time[4]; UTC-04',
'CEST': 'Central European Summer Time (Cf. HAEC); UTC+02',
'CET': 'Central European Time; UTC+01',
'CHADT': 'Chatham Daylight Time; UTC+13:45',
'CHAST': 'Chatham Standard Time; UTC+12:45',
'CHOT': 'Choibalsan Standard Time; UTC+08',
'CHOST': 'Choibalsan Summer Time; UTC+09',
'CHST': 'Chamorro Standard Time; UTC+10',
'CHUT': 'Chuuk Time; UTC+10',
'CIST': 'Clipperton Island Standard Time; UTC-08',
'CIT': 'Central Indonesia Time; UTC+08',
'CKT': 'Cook Island Time; UTC-10',
'CLST': 'Chile Summer Time; UTC-03',
'CLT': 'Chile Standard Time; UTC-04',
'COST': 'Colombia Summer Time; UTC-04',
'COT': 'Colombia Time; UTC-05',
'CST': 'Central Standard Time (North America); UTC-06',
'CST': 'China Standard Time; UTC+08',
'CST': 'Cuba Standard Time; UTC-05',
'CT': 'China Time; UTC+08',
'CVT': 'Cape Verde Time; UTC-01',
'CWST': 'Central Western Standard Time (Australia) unofficial; UTC+08:45',
'CXT': 'Christmas Island Time; UTC+07',
'DAVT': 'Davis Time; UTC+07',
'DDUT': 'Dumont d\'Urville Time; UTC+10',
'DFT': 'AIX-specific equivalent of Central European Time[NB 1]; UTC+01',
'EASST': 'Easter Island Summer Time; UTC-05',
'EAST': 'Easter Island Standard Time; UTC-06',
'EAT': 'East Africa Time; UTC+03',
'ECT': 'Eastern Caribbean Time (does not recognise DST); UTC-04',
'ECT': 'Ecuador Time; UTC-05',
'EDT': 'Eastern Daylight Time (North America); UTC-04',
'EEST': 'Eastern European Summer Time; UTC+03',
'EET': 'Eastern European Time; UTC+02',
'EGST': 'Eastern Greenland Summer Time; UTC+00',
'EGT': 'Eastern Greenland Time; UTC-01',
'EIT': 'Eastern Indonesian Time; UTC+09',
'EST': 'Eastern Standard Time (North America); UTC-05',
'FET': 'Further-eastern European Time; UTC+03',
'FJT': 'Fiji Time; UTC+12',
'FKST': 'Falkland Islands Summer Time; UTC-03',
'FKT': 'Falkland Islands Time; UTC-04',
'FNT': 'Fernando de Noronha Time; UTC-02',
'GALT': 'Galapagos Time; UTC-06',
'GAMT': 'Gambier Islands Time; UTC-09',
'GET': 'Georgia Standard Time; UTC+04',
'GFT': 'French Guiana Time; UTC-03',
'GILT': 'Gilbert Island Time; UTC+12',
'GIT': 'Gambier Island Time; UTC-09',
'GMT': 'Greenwich Mean Time; UTC+00',
'GST': 'South Georgia and the South Sandwich Islands Time; UTC-02',
'GST': 'Gulf Standard Time; UTC+04',
'GYT': 'Guyana Time; UTC-04',
'HDT': 'Hawaii-Aleutian Daylight Time; UTC-09',
'HAEC': 'Heure Avancee d\'Europe Centrale French-language name for CEST; UTC+02',
'HST': 'Hawaii-Aleutian Standard Time; UTC-10',
'HKT': 'Hong Kong Time; UTC+08',
'HMT': 'Heard and McDonald Islands Time; UTC+05',
'HOVST': 'Khovd Summer Time; UTC+08',
'HOVT': 'Khovd Standard Time; UTC+07',
'ICT': 'Indochina Time; UTC+07',
'IDLW': 'International Day Line West time zone; UTC-12',
'IDT': 'Israel Daylight Time; UTC+03',
'IOT': 'Indian Ocean Time; UTC+03',
'IRDT': 'Iran Daylight Time; UTC+04:30',
'IRKT': 'Irkutsk Time; UTC+08',
'IRST': 'Iran Standard Time; UTC+03:30',
'IST': 'Indian Standard Time; UTC+05:30',
'IST': 'Irish Standard Time[5]; UTC+01',
'IST': 'Israel Standard Time; UTC+02',
'JST': 'Japan Standard Time; UTC+09',
'KALT': 'Kaliningrad Time; UTC+02',
'KGT': 'Kyrgyzstan Time; UTC+06',
'KOST': 'Kosrae Time; UTC+11',
'KRAT': 'Krasnoyarsk Time; UTC+07',
'KST': 'Korea Standard Time; UTC+09',
'LHST': 'Lord Howe Standard Time; UTC+10:30',
'LHST': 'Lord Howe Summer Time; UTC+11',
'LINT': 'Line Islands Time; UTC+14',
'MAGT': 'Magadan Time; UTC+12',
'MART': 'Marquesas Islands Time; UTC-09:30',
'MAWT': 'Mawson Station Time; UTC+05',
'MDT': 'Mountain Daylight Time (North America); UTC-06',
'MET': 'Middle European Time Same zone as CET; UTC+01',
'MEST': 'Middle European Summer Time Same zone as CEST; UTC+02',
'MHT': 'Marshall Islands Time; UTC+12',
'MIST': 'Macquarie Island Station Time; UTC+11',
'MIT': 'Marquesas Islands Time; UTC-09:30',
'MMT': 'Myanmar Standard Time; UTC+06:30',
'MSK': 'Moscow Time; UTC+03',
'MST': 'Malaysia Standard Time; UTC+08',
'MST': 'Mountain Standard Time (North America); UTC-07',
'MUT': 'Mauritius Time; UTC+04',
'MVT': 'Maldives Time; UTC+05',
'MYT': 'Malaysia Time; UTC+08',
'NCT': 'New Caledonia Time; UTC+11',
'NDT': 'Newfoundland Daylight Time; UTC-02:30',
'NFT': 'Norfolk Island Time; UTC+11',
'NPT': 'Nepal Time; UTC+05:45',
'NST': 'Newfoundland Standard Time; UTC-03:30',
'NT': 'Newfoundland Time; UTC-03:30',
'NUT': 'Niue Time; UTC-11',
'NZDT': 'New Zealand Daylight Time; UTC+13',
'NZST': 'New Zealand Standard Time; UTC+12',
'OMST': 'Omsk Time; UTC+06',
'ORAT': 'Oral Time; UTC+05',
'PDT': 'Pacific Daylight Time (North America); UTC-07',
'PET': 'Peru Time; UTC-05',
'PETT': 'Kamchatka Time; UTC+12',
'PGT': 'Papua New Guinea Time; UTC+10',
'PHOT': 'Phoenix Island Time; UTC+13',
'PHT': 'Philippine Time; UTC+08',
'PKT': 'Pakistan Standard Time; UTC+05',
'PMDT': 'Saint Pierre and Miquelon Daylight Time; UTC-02',
'PMST': 'Saint Pierre and Miquelon Standard Time; UTC-03',
'PONT': 'Pohnpei Standard Time; UTC+11',
'PST': 'Pacific Standard Time (North America); UTC-08',
'PST': 'Philippine Standard Time; UTC+08',
'PYST': 'Paraguay Summer Time[6]; UTC-03',
'PYT': 'Paraguay Time[7]; UTC-04',
'RET': 'Reunion Time; UTC+04',
'ROTT': 'Rothera Research Station Time; UTC-03',
'SAKT': 'Sakhalin Island Time; UTC+11',
'SAMT': 'Samara Time; UTC+04',
'SAST': 'South African Standard Time; UTC+02',
'SBT': 'Solomon Islands Time; UTC+11',
'SCT': 'Seychelles Time; UTC+04',
'SDT': 'Samoa Daylight Time; UTC-10',
'SGT': 'Singapore Time; UTC+08',
'SLST': 'Sri Lanka Standard Time; UTC+05:30',
'SRET': 'Srednekolymsk Time; UTC+11',
'SRT': 'Suriname Time; UTC-03',
'SST': 'Samoa Standard Time; UTC-11',
'SST': 'Singapore Standard Time; UTC+08',
'SYOT': 'Showa Station Time; UTC+03',
'TAHT': 'Tahiti Time; UTC-10',
'THA': 'Thailand Standard Time; UTC+07',
'TFT': 'Indian/Kerguelen; UTC+05',
'TJT': 'Tajikistan Time; UTC+05',
'TKT': 'Tokelau Time; UTC+13',
'TLT': 'Timor Leste Time; UTC+09',
'TMT': 'Turkmenistan Time; UTC+05',
'TRT': 'Turkey Time; UTC+03',
'TOT': 'Tonga Time; UTC+13',
'TVT': 'Tuvalu Time; UTC+12',
'ULAST': 'Ulaanbaatar Summer Time; UTC+09',
'ULAT': 'Ulaanbaatar Standard Time; UTC+08',
'UTC': 'Coordinated Universal Time; UTC+00',
'UYST': 'Uruguay Summer Time; UTC-02',
'UYT': 'Uruguay Standard Time; UTC-03',
'UZT': 'Uzbekistan Time; UTC+05',
'VET': 'Venezuelan Standard Time; UTC-04',
'VLAT': 'Vladivostok Time; UTC+10',
'VOLT': 'Volgograd Time; UTC+04',
'VOST': 'Vostok Station Time; UTC+06',
'VUT': 'Vanuatu Time; UTC+11',
'WAKT': 'Wake Island Time; UTC+12',
'WAST': 'West Africa Summer Time; UTC+02',
'WAT': 'West Africa Time; UTC+01',
'WEST': 'Western European Summer Time; UTC+01',
'WET': 'Western European Time; UTC+00',
'WIT': 'Western Indonesian Time; UTC+07',
'WST': 'Western Standard Time; UTC+08',
'YAKT': 'Yakutsk Time; UTC+09',
'YEKT': 'Yekaterinburg Time; UTC+05',
}
ampm = {
'MIDNIGHT': 'AM',
'MIDNITE': 'AM',
'MIDDAY': 'PM',
'IN THE AFTERNOON': 'PM',
'AFTERNOON': 'PM',
'MORNING': 'AM',
'IN THE MORNING': 'AM',
'NOON': 'PM',
'MN': 'AM',
'NN': 'PM',
'H': 'HRS',
'HR': 'HRS',
'HRS': 'HRS',
'HOURS': 'HRS',
'A. M.': 'AM',
'A.M.': 'AM',
'A.M': 'AM',
'AM.': 'AM',
'AM': 'AM',
'P. M.': 'PM',
'P.M.': 'PM',
'P.M': 'PM',
'PM.': 'PM',
'PM': 'PM',
}
if __name__ == '__main__':
print('days')
print(AhoCorasickReplace().update(days).to_regex())
print('months')
print(AhoCorasickReplace().update(months).to_regex())
print('timezones')
print(AhoCorasickReplace().update(timezones).to_regex())
print('ampm')
print(AhoCorasickReplace().update(ampm).to_regex())