-
Notifications
You must be signed in to change notification settings - Fork 0
/
parse-nodes_sg.tdl
657 lines (560 loc) · 15.7 KB
/
parse-nodes_sg.tdl
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
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
;;; -*- Mode: tdl; Coding: utf-8; -*-
;;;
;;; Copyright (c) 1994-2018
;;; Dan Flickinger, Rob Malouf, Emily M. Bender
;;; see LICENSE for conditions
;;;
;;; parsenodes.tdl
;;;
;;; Parse node definitions to support node labels in printed parse trees
;;;
;;; Created: Dan Flickinger 15-Aug-94
;;;
;;; $Id: parse-nodes.tdl 28901 2020-07-25 23:47:43Z danf $
;;; AAC - for the LKB, the order of definitions in the file is significant
;;; because the definitions are tried in order until one matches.
;;; This replaces the functionality of the variable *node-labels*
;;; in the PAGE machinery
; CSY 25-09-2020 - add in new S to allow adj headed sentences to be labelled 'S'
; CSY 9-10-2020 - PRD is a feature that marks for if something can follow a copula
; and not if something can head a clause
; 19-1-2021 MC bool for both MC and NMC
s-singlish := label &
"""
CSY 25-09-2020 - added MC + to prevent adj from being labelled as S
5-10-2020 - add in PRD + so that "beautiful or beautiful" will not be labelled as 'S'
in 'It beautiful or beautiful'. BUT it does not work because the daughters are PRD bool
9-10-2020 - changed to PRD - for the same reason
<ex> He beautiful.
"""
[ SYNSEM.LOCAL [ CAT [ HEAD adj &
[ PRD - ],
VAL [ SUBJ *olist*,
SPR *olist*,
COMPS < > ],
MC bool ],
CONJ cnil ],
INFLECTD +,
LNAME "Sⱼ" ].
; 31-5-2021 - for particle headed sentences. to change label from XP
s-particle := label &
"""
<ex> He is so beautiful sia.
"""
[ SYNSEM.LOCAL [ CAT [ HEAD basic_particle_or_sfa &
[ PRD - ],
VAL [ SUBJ *olist*,
SPR *olist*,
COMPS < > ],
MC + ],
CONJ cnil ],
INFLECTD +,
LNAME "Sₚₐᵣₜ" ].
; 31-5-2021 - for particles to change label from FRG
particle := label &
"""
<ex> He is so beautiful (sia).
"""
[ SYNSEM.LOCAL [ CAT [ HEAD basic_particle &
[ PRD - ],
VAL [ COMPS < synsem_min2 > ]],
CONJ cnil ],
INFLECTD +,
LNAME "SFP" ].
slash := meta &
[ SYNSEM.NONLOC.SLASH 1-dlist &
[ LIST < local_basic > ],
META-PREFIX "/",
META-SUFFIX "" ].
frag-s := label &
[ SYNSEM synsem &
[ LOCAL [ CAT [ HEAD frag,
VAL [ COMPS < >,
SPR < >,
SUBJ < > ] ] ] ],
INFLECTD +,
LNAME "XP" ].
conj-s := label &
[ SYNSEM synsem &
[ LOCAL [ CAT.VAL.COMPS *cons*,
CONJ complex-conj ] ],
INFLECTD +,
LNAME "CONJ" ].
conj-s2 := label &
[ SYNSEM synsem &
[ LOCAL [ CAT.VAL.COMPS *cons*,
ARG-S *cons*,
CONJ atomic-conj ] ],
INFLECTD +,
LNAME "CONJ" ].
conj-s3 := label &
[ SYNSEM synsem &
[ LOCAL [ CAT [ HEAD conj-s,
VAL.COMPS < > ],
CONJ cnil ] ],
INFLECTD +,
LNAME "S" ].
nohead := label &
[ SYNSEM.LOCAL.CAT.HEAD no_head,
INFLECTD +,
LNAME "XP" ].
pp-i := label &
[ SYNSEM.LOCAL.CAT [ HEAD basic_prep &
[ MOD < [ LOCAL intersective_mod ] > ],
VAL.COMPS < > ],
LNAME "PP" ].
p-n := label &
[ SYNSEM.LOCAL.CAT [ HEAD basic_prep &
[ MOD < > ],
VAL.COMPS *cons* ],
LNAME "P" ].
p-i := label &
[ SYNSEM.LOCAL.CAT [ HEAD basic_prep &
[ MOD < [ LOCAL intersective_mod ] > ],
VAL.COMPS *cons* ],
LNAME "P" ].
p-s := label &
[ SYNSEM.LOCAL.CAT [ HEAD basic_prep &
[ MOD < [ LOCAL scopal_mod ] > ],
VAL.COMPS *cons* ],
LNAME "P" ].
pp-n := label &
[ SYNSEM.LOCAL.CAT [ HEAD prep &
[ MOD < > ],
VAL.COMPS < > ],
LNAME "PP" ].
pp-s := label &
[ SYNSEM.LOCAL.CAT [ HEAD basic_prep &
[ MOD < [ LOCAL scopal_mod ] > ],
VAL.COMPS < > ],
LNAME "PP" ].
coord-v := label &
[ SYNSEM.LOCAL [ CAT [ HEAD verb,
VAL.COMPS *cons* ],
CONT.HOOK.INDEX conj_event ],
LNAME "V" ].
comp := label &
[ SYNSEM.LOCAL.CAT [ HEAD comp,
VAL.COMPS *cons* ],
LNAME "COMP" ].
prdp-i := label &
[ SYNSEM.LOCAL.CAT [ HEAD a_or_p &
[ PRD + ],
VAL [ SPR < anti_synsem_min >,
SUBJ < anti_synsem_min >,
COMPS < > ] ],
LNAME "PRDP" ].
;; Right half of conjoined VP
vp-conj := label &
[ SYNSEM.LOCAL [ CAT [ HEAD verb,
VAL [ SUBJ < synsem >,
COMPS < > ] ],
CONJ complex-conj ],
INFLECTD +,
LNAME "VP-C" ].
vp-conj2 := label &
[ SYNSEM.LOCAL [ CAT [ HEAD verb,
VAL [ SUBJ < synsem >,
COMPS < > ] ],
CONJ atomic-conj ],
INFLECTD +,
LNAME "VP-C" ].
; Passive VPs
vpp := label &
[ SYNSEM.LOCAL.CAT [ HEAD verb &
[ VFORM pas ],
VAL [ SUBJ < synsem >,
COMPS < > ] ],
INFLECTD +,
LNAME "VP" ].
; Pres-part VPs
vp-prp := label &
[ SYNSEM.LOCAL.CAT [ HEAD verb &
[ VFORM prp ],
VAL [ SUBJ < synsem >,
COMPS < > ] ],
INFLECTD +,
LNAME "VP" ].
vplex := label &
[ SYNSEM [ LOCAL [ CAT [ HEAD verb & [ AUX +],
VAL [ SUBJ < synsem & [ OPT - ] >,
COMPS < > ] ],
CONJ cnil ],
LEX + ],
INFLECTD +,
LNAME "VP" ].
vp := label &
[ SYNSEM.LOCAL [ CAT [ HEAD verb,
VAL [ SUBJ < synsem &
[ OPT - ] >,
COMPS < > ] ],
CONJ cnil ],
INFLECTD +,
LNAME "VP" ].
vpinf := label &
[ SYNSEM.LOCAL.CAT [ HEAD comp,
VAL [ SUBJ < synsem >,
COMPS < > ] ],
LNAME "VP" ].
v := label &
[ SYNSEM.LOCAL.CAT [ HEAD verb,
VAL.COMPS *cons* ],
INFLECTD +,
LNAME "V" ].
tagaux := label &
[ SYNSEM.LOCAL.CAT [ HEAD tagaux,
VAL.COMPS *cons* ],
INFLECTD +,
LNAME "V" ].
s-r := label &
[ SYNSEM.LOCAL [ CAT [ HEAD verbal,
VAL [ SUBJ *anti_list*,
COMPS < > ],
MC + ] ],
INFLECTD +,
LNAME "S" ].
s-r-sub := label &
[ SYNSEM.LOCAL [ CAT [ HEAD verbal,
VAL [ SUBJ < >,
COMPS < > ],
MC na_or_- ] ],
INFLECTD +,
LNAME "S" ].
s-r1-sub := label &
[ SYNSEM [ LOCAL [ CAT [ HEAD verbal & [ VFORM fin_or_inf ],
VAL [ SUBJ < anti_synsem >,
COMPS < > ],
MC na_or_- ] ] ],
INFLECTD +,
LNAME "S" ].
s-r1 := label &
[ SYNSEM [ LOCAL [ CAT [ HEAD verbal & [ VFORM fin_or_inf_or_imp ],
VAL [ SUBJ < anti_synsem >,
COMPS < > ] ] ] ],
INFLECTD +,
LNAME "S" ].
s1-sub := label &
[ SYNSEM.LOCAL [ CAT [ HEAD verb,
VAL [ SUBJ *olist*,
SPR *olist*,
COMPS < > ],
MC na_or_- ] ],
INFLECTD +,
LNAME "S" ].
s1 := label &
[ SYNSEM.LOCAL [ CAT [ HEAD verb,
VAL [ SUBJ *olist*,
SPR *olist*,
COMPS < > ] ] ],
INFLECTD +,
LNAME "S" ].
s2-sub := label &
[ SYNSEM.LOCAL [ CAT [ HEAD verb & [ VFORM fin_or_inf_or_imp ],
VAL [ SUBJ < unexpressed >,
SPR *olist*,
COMPS < > ],
MC na_or_- ] ],
INFLECTD +,
LNAME "S" ].
s2 := label &
[ SYNSEM.LOCAL [ CAT [ HEAD verb & [ VFORM fin_or_inf_or_imp ],
VAL [ SUBJ < unexpressed >,
SPR *olist*,
COMPS < > ] ] ],
INFLECTD +,
LNAME "S" ].
s1-c := label &
[ SYNSEM.LOCAL.CAT [ HEAD comp,
VAL [ SUBJ *olist*,
SPR *olist*,
COMPS < > ] ],
INFLECTD +,
LNAME "S" ].
s-r2-sub := label &
[ SYNSEM.LOCAL [ CAT [ HEAD verbal & [ VFORM fin_or_inf_or_imp ],
VAL [ SUBJ < >,
COMPS < > ],
MC na_or_- ] ],
LNAME "S" ].
s-r2 := label &
[ SYNSEM.LOCAL [ CAT [ HEAD verbal & [ VFORM fin_or_inf_or_imp ],
VAL [ SUBJ < >,
COMPS < > ] ] ],
LNAME "S" ].
; 28-7-2021 remove first
; 31-7-2021 label that takes into account the 3SGINFL value
s-nosubj := label &
[ SYNSEM.LOCAL [ CAT.HEAD frag & [ MINORS.ALTMIN role_rel,
3SGINFL 3sg_unk ],
CONJ lex-conj ],
LNAME "S" ].
s-frag := label &
[ SYNSEM.LOCAL [ CAT.HEAD frag & [ MINORS.ALTMIN role_rel ],
CONJ lex-conj ],
LNAME "XP" ].
; For title nouns like in "professor smith"
;nt := label &
; [ SYNSEM.LOCAL.CAT.HEAD adv & [ MOD < [ LOCAL.CAT.HEAD noun ] > ],
; INFLECTD +,
; LNAME "N" ].
adv-dg := label &
[ SYNSEM.LOCAL [ CAT.HEAD adv & [ MOD < > ],
CONJ cnil ],
LNAME "ADV" ].
adv1a := label &
[ SYNSEM.LOCAL [ CAT [ HEAD basic_adv,
POSTHD + ],
CONJ cnil ],
INFLECTD +,
LNAME "ADV" ].
adv1b := label &
[ SYNSEM.LOCAL [ CAT [ HEAD basic_adv,
POSTHD - ],
CONJ cnil ],
INFLECTD +,
LNAME "ADV" ].
adv1c := label &
[ SYNSEM.LOCAL [ CAT.HEAD basic_adv,
CONJ cnil ],
INFLECTD +,
LNAME "ADV" ].
adv2 := label &
[ SYNSEM.LOCAL [ CAT.HEAD root-marker,
CONJ cnil ],
INFLECTD +,
LNAME "ADV" ].
adv3 := label &
[ SYNSEM.LOCAL [ CAT.HEAD detspec,
CONJ cnil ],
INFLECTD +,
LNAME "ADV" ].
adv4 := label &
[ SYNSEM.LOCAL [ CAT.HEAD basic_adv,
CONJ complex-conj ],
INFLECTD +,
LNAME "ADV-C" ].
adv4-2 := label &
[ SYNSEM.LOCAL [ CAT.HEAD basic_adv,
CONJ atomic-conj ],
INFLECTD +,
LNAME "ADV-C" ].
; 11-8-2021 add in for sentence final adverbs like 'already' and possibly 'only'
;adv_sf := label &
; [ SYNSEM.LOCAL [ CAT [ HEAD basic_sfa ],
; CONJ cnil ],
; INFLECTD +,
; LNAME "ADV-F" ].
n := label &
[ SYNSEM.LOCAL.CAT [ HEAD nominal,
VAL [ SPR *cons* &
[ FIRST synsem &
[ OPT -,
LOCAL.CAT.HEAD det ] ],
COMPS < > ] ],
INFLECTD na_or_+,
LNAME "N" ].
nc := label &
[ SYNSEM.LOCAL.CAT [ HEAD nominal,
VAL [ SPR *cons* &
[ FIRST synsem &
[ OPT - ] ],
COMPS *cons* ] ],
INFLECTD +,
LNAME "N" ].
ngl := label &
[ SYNSEM.LOCAL.CAT [ HEAD gerund,
VAL [ SUBJ *cons* &
[ FIRST synsem ],
SPR.FIRST synsem,
COMPS < > ] ],
INFLECTD +,
LNAME "N" ].
nx := label &
[ SYNSEM.LOCAL.CAT [ HEAD nominal,
VAL [ SPR < synsem &
[ OPT - ] >,
COMPS < [ OPT - ], ... > ] ],
INFLECTD +,
LNAME "NX" ].
adj := label &
[ SYNSEM.LOCAL.CAT [ HEAD adj,
VAL.COMPS < synsem_min, ... > ],
INFLECTD na_or_+,
LNAME "ADJ" ].
adjp := label &
[ SYNSEM.LOCAL.CAT [ HEAD adj,
VAL.COMPS < > ],
INFLECTD na_or_+,
LNAME "AP" ].
numadj := label &
[ SYNSEM.LOCAL.CAT.HEAD intadj,
INFLECTD +,
LNAME "ADJ" ].
supadj := label &
[ SYNSEM.LOCAL.CAT.HEAD superl_adj,
INFLECTD +,
LNAME "ADJ" ].
compadj := label &
[ SYNSEM.LOCAL.CAT.HEAD compar_adj,
INFLECTD +,
LNAME "ADJ" ].
np-conj := label &
[ SYNSEM [ LOCAL [ CAT [ HEAD nominal,
VAL [ SPR *olist* ] ],
CONT.HOOK.INDEX ref-ind,
CONJ complex-conj ],
NONLOC.QUE 0-dlist ],
INFLECTD +,
LNAME "NP-CJ" ].
np-conj-2 := label &
[ SYNSEM [ LOCAL [ CAT [ HEAD nominal,
VAL [ SPR *olist* ] ],
CONJ atomic-conj ],
NONLOC.QUE 0-dlist ],
INFLECTD +,
LNAME "NP-CJ" ].
pp-np := label &
[ SYNSEM [ LOCAL [ CAT [ HEAD modnp,
VAL.COMPS < > ],
CONJ cnil ] ],
INFLECTD +,
LNAME "PP" ].
pp-np-conj := label &
[ SYNSEM [ LOCAL [ CAT [ HEAD modnp,
VAL.COMPS < > ],
CONJ complex-conj ] ],
INFLECTD +,
LNAME "PP-CJ" ].
n-title := label &
[ SYNSEM [ LOCAL [ CAT.HEAD ttl,
CONJ cnil ],
NONLOC.QUE 0-dlist ],
INFLECTD +,
LNAME "N" ].
npc := label &
[ SYNSEM [ LOCAL [ CAT [ HEAD nominal,
VAL [ SPR *olist*,
COMPS < canonical_synsem > ] ],
CONT.HOOK.INDEX ref-ind,
CONJ cnil ],
NONLOC.QUE 0-dlist ],
INFLECTD +,
LNAME "NP" ].
np-t := label &
[ SYNSEM [ LOCAL [ CAT [ HEAD nominal &
[ MINORS.MIN temp_abstr_rel ],
VAL [ SPR *olist* ] ],
CONT.HOOK.INDEX ref-ind,
CONJ cnil ],
NONLOC.QUE 0-dlist ],
INFLECTD +,
LNAME "NP" ].
np := label &
[ SYNSEM [ LOCAL [ CAT [ HEAD nominal,
VAL.SPR *olist* ],
CONT.HOOK.INDEX non_expl,
CONJ cnil ],
NONLOC.QUE 0-dlist ],
LNAME "NP" ].
;; for partitives with do-be as in |all he does|
npd := label &
[ SYNSEM [ LOCAL [ CAT [ HEAD nominal,
VAL [ SPR *anti_cons*,
SUBJ *anti_list* ] ],
CONT.HOOK.INDEX non_expl,
CONJ cnil ],
NONLOC.QUE 0-dlist ],
LNAME "NP" ].
npx := label &
[ SYNSEM.LOCAL [ CAT.HEAD nominal,
CONT.HOOK.INDEX expl-ind,
CONJ cnil ],
INFLECTD +,
LNAME "NP-X" ].
npp := label &
[ SYNSEM.LOCAL [ CAT [ HEAD nominal,
VAL.SPR *cons* &
[ FIRST.LOCAL.CAT.HEAD adv ] ],
CONT.HOOK.INDEX ref-ind ],
INFLECTD +,
LNAME "NP" ].
np-wh := label &
[ SYNSEM [ LOCAL.CAT [ HEAD nominal,
VAL [ SPR *olist* ] ],
NONLOC.QUE 1-dlist ],
INFLECTD +,
LNAME "NP-WH" ].
np-rel := label &
[ SYNSEM [ LOCAL.CAT [ HEAD nominal,
VAL [ SPR *olist* ] ],
NONLOC.REL 1-dlist ],
INFLECTD +,
LNAME "NP-R" ].
nedadj := label &
[ SYNSEM.LOCAL.CAT.HEAD n-ed,
LNAME "AP" ].
det := label &
[ SYNSEM.LOCAL.CAT.HEAD det,
LNAME "DET" ].
ladv := label &
[ SYNSEM.LOCAL.CAT.HEAD basic_lexadv,
LNAME "LADV" ].
ttl-label := label &
[ SYNSEM [ LOCAL [ CAT.HEAD ttl,
CONJ cnil ] ],
INFLECTD +,
LNAME "NP" ].
prdp := label &
[ SYNSEM.LOCAL.CAT [ HEAD.PRD +,
VAL.COMPS < > ],
INFLECTD +,
LNAME "XP" ].
punct := label &
[ SYNSEM.LOCAL.CAT.HEAD punct_hd,
LNAME "PT" ].
punct_pr := label &
[ SYNSEM.LOCAL.CAT.HEAD punct_pair_hd,
LNAME "PT" ].
quotedword := label &
[ SYNSEM.LOCAL.CAT.HEAD fw,
LNAME "QW" ].
frg := label &
[ INFLECTD +,
LNAME "FRG" ].
bridge_binary := label &
[ INFLECTD -,
SYNSEM.LOCAL.CAT.HEAD bridge_head,
LNAME "BP" ].
bridge_unary := label &
[ INFLECTD na,
SYNSEM [ LOCAL.CAT.HEAD bridge_head,
LEX - ],
LNAME "BX" ].
bridge_lex := label &
[ INFLECTD na,
SYNSEM [ LOCAL.CAT.HEAD bridge_head,
LEX + ],
LNAME "BLX" ].
nstemlabel := label &
[ INFLECTD na_or_-,
SYNSEM.LOCAL.CAT.HEAD nominal,
LNAME "N" ].
ttlstemlabel := label &
[ INFLECTD -,
SYNSEM.LOCAL.CAT.HEAD ttl,
LNAME "N" ].
astemlabel := label &
[ INFLECTD -,
SYNSEM.LOCAL.CAT.HEAD adj,
LNAME "ADJ" ].
vstemlabel := label &
[ INFLECTD na_or_-,
SYNSEM.LOCAL.CAT.HEAD verb,
LNAME "V" ].
stemlabel := label &
[ INFLECTD -,
LNAME "STEM" ].
quotedlabel := label &
[ INFLECTD na,
SYNSEM.LOCAL.CAT.HEAD no_head,
LNAME "QW" ].