-
Notifications
You must be signed in to change notification settings - Fork 2
/
lcc_data.py
550 lines (505 loc) · 15.1 KB
/
lcc_data.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
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
from collections import defaultdict as dd
masked_tags = ['###MASKED-AUTHOR###',
'###MASKED-GROUP###',
'###MASKED-LECTURER###']
exclude_elems_containing = [
"http://bit.ly/1PMaL42",
"University’s honour code and pledge",
"consent for our assignment to be used",
"assignment will not be marked unless"
] + masked_tags
exclude_sents_swith = [
"name:",
"name :",
"names:",
"name of student:",
"name of student :",
"student’s (official) name",
"student’s name",
"author:",
"team members:",
"group members:",
"group member:",
"members:",
"group:",
"group –",
"group number:",
"group no.:",
"group no:",
"by:",
"done by:",
"submitted by:",
"prepared by:",
"proposal submitted by:",
"proposal by:",
"matriculation number:",
"matriculation number :",
"matriculation no.",
"matric no.",
"matric no.:",
"matric:",
"matric :",
"matric number:",
"matric number :",
"tutorial group number",
"tutorial day",
"tutorial group",
"class code:",
"class :",
"class:",
"tutor:",
"faculty name:",
"tutor name:",
"tutor’s name",
"for:",
"submitted to:",
"lecturer-in-charge:",
"title:",
"title of proposal:",
"proposal title:",
"assignment title",
"assignment 2",
"school name:",
"school:",
"school of",
"division of",
"university:",
"faculty:",
"date submitted:",
"date submitted :",
"date of submission:",
"date of submission :",
"data of submission :",
"data of submission:",
"date of sumission:",
"date of sumission :",
"data of sumission :",
"data of sumission:",
"date of submision:",
"date of submision :",
"data of submision :",
"data of submision:",
"date:",
"due:",
"engineering communication",
"hw0188 engineering communication",
"hw0188: engineering communication",
"hw0188 (engineering communication)",
"hw0188 - engineering communication",
"course code:",
"course:",
"module code:",
"module:",
"code:",
"cover page",
"word count:",
"source:",
"diagrams:",
"design:",
"available at:",
"plagiarism declaration form",
"penalties will be imposed for late submissions",
"i/we have read and understood the guidelines on academic dishonesty",
"we have read and understood the guidelines on academic dishonesty",
"i have read and understood the guidelines on academic dishonesty",
"student’s signature:",
"penalties will be imposed for late submission and plagiarism",
"please refer to the general instructions for details",
"note: the assignment will not be marked unless this form is completed and signed",
"note: the assignment will not be marked unless",
"figure a:", "figure a.", "figure a -", "fig a:", "fig a.", "fig a -",
"figure b:", "figure b.", "figure b -", "fig b:", "fig b.", "fig b -",
"figure c:", "figure c.", "figure c -", "fig c:", "fig c.", "fig c -",
"figure d:", "figure d.", "figure d -", "fig d:", "fig d.", "fig d -",
"figure e:", "figure e.", "figure e -", "fig e:", "fig e.", "fig e -",
"figure f:", "figure f.", "figure f -", "fig f:", "fig f.", "fig f -",
"figure 1:", "figure 1.", "figure 1 -", "fig 1:", "fig 1.", "fig 1 -",
"figure 2:", "figure 2.", "figure 2 -", "fig 2:", "fig 2.", "fig 2 -",
"figure 3:", "figure 3.", "figure 3 -", "fig 3:", "fig 3.", "fig 3 -",
"figure 4:", "figure 4.", "figure 4 -", "fig 4:", "fig 4.", "fig 4 -",
"figure 5:", "figure 5.", "figure 5 -", "fig 5:", "fig 5.", "fig 5 -",
"figure 6:", "figure 6.", "figure 6 -", "fig 6:", "fig 6.", "fig 6 -",
"table 1:", "table 1.", "table 1 -",
"table 2:", "table 2.", "table 2 -",
"table 3:", "table 3.", "table 3 -",
"table 4:", "table 4.", "table 4 -",
"table 5:", "table 5.", "table 5 -",
"table 6:", "table 6.", "table 6 -",
"table 7:", "table 7.", "table 7 -"
]
punctuation = """!"“”#$%&\'*+,./:;<=>?@\\^_`{|}~‘’"""
refs_section = ['reference', 'references', 'bibliography', 'source', 'sources',
'works cited', 'references:', 'reference:', 'bibliography:',
'source:', 'sources:', 'works cited:', 'references (apa):',
'references (ieee):', 'citations (use apa)', 'citations',
'citations:', 'referencing', 'refeences']
exclude_sents = [
"costs/budget:",
"cost/budget:",
"cost:",
"costs:",
"the estimated cost per unit (SGD):",
"the estimated cost per unit:",
"basic cost:",
"cost of implementation:",
"conclusion:",
"implementation:",
"benefits:",
"engineering communication i",
"background:",
"problem:",
"solution:"
] + refs_section
wordchoice = set(["I would like to say",
"to wrap up",
"come up with",
"total waste of time",
"come into play",
"without further ado",
"tons of",
"fork out"])
# CHECK FOR PET PEEVES
wordcheck = dd(list)
# Wordcheck is checked at lemma level (important for verbs)
wordcheck['Informal'] = set(['hassle',
'tackle',
'stuff',
'stuffs',
'handy',
'air-con',
'info',
'fantastic',
'humongous',
'cash'])
wordcheck['Formal'] = set(['aforementioned'])
wordcheck['PronounStyle']= set(["i",
"me",
"mine",
"my",
"myself",
"you",
"your",
"yours",
"yourself"])
contractions = set(["ain't",
"aren't",
"can't",
"could've",
"couldn't",
"didn't",
"doesn't",
"don't",
"gonna",
"gotta",
"hadn't",
"hasn't",
"haven't",
"he'd",
"he'll",
"he's",
"how'd",
"how'll",
"how's",
"I'd",
"I'll",
"I'm",
"I've",
"isn't",
"it'd",
"it'll",
"it's",
"mayn't",
"may've",
"mightn't",
"might've",
"mustn't",
"must've",
"needn't",
"oughtn't",
"shan't",
"she'd",
"she'll",
"she's",
"should've",
"shouldn't",
"that'll",
"that're",
"that's",
"that'd",
"there'd",
"there're",
"there's",
"these're",
"they'd",
"they'll",
"they're",
"they've",
"this's",
"those're",
"wasn't",
"we'd",
"we'll",
"we're",
"we've",
"weren't",
"what'd",
"what'll",
"what're",
"what's",
"what've",
"when's",
"where'd",
"where're",
"where's",
"where've",
"which's",
"who'd",
"who'll",
"who're",
"who's",
"who've",
"why'd",
"why're",
"why's",
"won't",
"would've",
"wouldn't",
"y'all",
"you'd",
"you'll",
"you're",
"you've"])
new_contractions = set([])
for c in contractions:
new_contractions.add(c.replace("'","’"))
contractions = contractions | new_contractions
wordcase_ntu = set(["Executive Committee",
"Student Services Center",
"Student Services Centre",
"Jurong East",
"NTU",
"Student Union",
"Computer Science",
"Google",
"Microsoft",
"Singaporeans",
"Singaporean",
"Singapore",
"School of Engineering",
"Nanyang Techonological University",
"MRT",
"EZ-Link"])
months = set(["January",
"February",
"March",
"April",
# "May", is ambigous, leaving it out
"June",
"July",
"August",
"September",
"October",
"November",
"December"])
places = set(["Alexandra",
"Aljunied",
"Geylang",
"Ayer Rajah",
"Balestier",
"Bartley",
"Bishan",
"Marymount",
"Sin Ming",
"Bukit Timah",
"Sixth Avenue",
"Buona Vista",
"Holland Village",
"One North",
"Ghim Moh",
"Chinatown",
"Clarke Quay",
"Kreta Ayer",
"Telok Ayer",
"Kallang",
"Bendemeer",
"Geylang Bahru",
"Kallang Bahru",
"Kallang Basin",
"Kolam Ayer",
"Tanjong Rhu",
"Mountbatten",
"Old Airport",
"Lavender",
"Boon Keng",
"Kent Ridge",
"Kim Seng",
"Little India",
"Farrer Park",
"Jalan Besar",
"MacPherson",
"Marina Bay",
"Esplanade",
"Marina Bay Sands",
"Marina Centre",
"Marina East",
"Marina South",
"Mount Faber",
"Mount Vernon",
"Museum",
"Newton",
"Novena",
"Orchard Road",
"Dhoby Ghaut",
"Emerald Hill",
"Peranakan Place",
"Tanglin",
"Outram",
"Pasir Panjang",
"Paya Lebar",
"Eunos",
"Geylang East",
"Potong Pasir",
"Rochor-Kampong Glam",
"Bencoolen",
"Bras Basah",
"Bugis",
"Queenstown",
"Dover",
"Commonwealth",
"Raffles Place",
"River Valley",
"Singapore River",
"Southern Islands",
"Tanjong Pagar",
"Shenton Way",
"Telok Blangah",
"Bukit Chandu",
"Bukit Purmei",
"HarbourFront",
"Keppel",
"Radin Mas",
"Mount Faber",
"Tiong Bahru",
"Bukit Ho Swee",
"Bukit Merah",
"Toa Payoh",
"Bukit Brown",
"Caldecott Hill",
"Thomson",
"Whampoa",
"St. Michael's",
"Bedok",
"Bedok Reservoir",
"Chai Chee",
"Kaki Bukit",
"Tanah Merah",
"Changi",
"Changi Bay",
"Changi East",
"Changi Village",
"East Coast",
"Joo Chiat",
"Katong",
"Kembangan",
"Pasir Ris",
"Elias",
"Lorong Halus",
"Loyang",
"Marine Parade",
"Siglap",
"Tampines",
"Simei",
"Ubi",
"Central Catchment Nature Reserve",
"Kranji",
"Lentor",
"Lim Chu Kang",
"Neo Tiew",
"Sungei Gedong",
"Mandai",
"Sembawang",
"Canberra",
"Senoko",
"Simpang",
"Sungei Kadut",
"Woodlands",
"Admiralty",
"Innova",
"Marsiling",
"Woodgrove",
"Yishun",
"Chong Pang",
"Ang Mo Kio",
"Cheng San",
"Chong Boon",
"Kebun Baru",
"Teck Ghee",
"Yio Chu Kang",
"Bidadari",
"Hougang",
"Defu",
"Kovan",
"Lorong Chuan",
"North-Eastern Islands",
"Punggol",
"Punggol Point",
"Punggol New Town",
"Seletar",
"Sengkang",
"Serangoon",
"Serangoon Gardens",
"Serangoon North",
"Boon Lay",
"Tukang",
"Liu Fang",
"Samulun",
"Shipyard",
"Bukit Batok",
"Bukit Gombak",
"Hillview",
"Guilin",
"West",
"East",
"Bukit Panjang",
"Choa Chu Kang",
"Yew Tee",
"Clementi",
"Toh Tuck",
"West Coast",
"Jurong East",
"Toh Guan",
"International Business Park",
"Teban Gardens",
"Pandan Gardens",
"Penjuru",
"Yuhua",
"Jurong Regional Centre",
"Lake",
"River",
"Port",
"Jurong West",
"Hong Kah",
"Taman Jurong",
"Boon Lay Place",
"Chin Bee",
"Yunnan",
"Kian Teck",
"Safti",
"Wenya",
"Lim Chu Kang",
"Pioneer",
"Joo Koon",
"Gul Circle",
"Pioneer Sector",
"Tengah",
"Tuas",
"Wrexham",
"Promenade",
"Pioneer",
"Soon Lee",
"Tuas South",
"Western Islands Planning Area",
"Western Water Catchment",
"Murai",
"Sarimbun"])
wordcase = wordcase_ntu | months | places