-
Notifications
You must be signed in to change notification settings - Fork 3
/
lexrinst.tdl
646 lines (567 loc) · 12.6 KB
/
lexrinst.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
;;; -*- Mode: tdl; Coding: utf-8; -*-
;;;
;;; Copyright (c) 1994-2018
;;; Dan Flickinger, Rob Malouf, Emily M. Bender
;;; see LICENSE for conditions
;;;
;;; lexrinst.tdl
;;;
;;; Instances of lexical rules defined in lexrules.tdl
;;;
;;; Created: Ann Copestake, 30-Sept-97
;;;
;;; $Id: lexrinst.tdl 7043 2009-09-03 18:26:55Z oe $
v_aux-sb-inv_dlr := sai_nonell_lexrule &
"""
Subject-auxiliary inversion
<ex>Did they arrive?
"""
[ RNAME lsai ].
v_aux-sb-inv-ell_dlr := sai_ell_lexrule &
"""
Subject-auxiliary inversion with elided verbs
<ex>Did they?
"""
[ RNAME lsaie ].
v_cond-inv_dlr := cond_sai &
"""
Conditional inversion
<ex>Had he left, we'd have left.
"""
[ RNAME csai ].
v_aux-advadd_dlr := adv_addition &
"""
Addition of adverb as complement
<ex>They did not arrive.
"""
[ RNAME ladv ].
v_aux-neg-ell_dlr := adv_add_neg_ellipt &
"""
Elided VP with negation
<ex>They would not.
"""
[ RNAME lnav ].
v_aux-ell-ref_dlr := vp_ellipsis_ref &
"""
Elided VP compl, referentl subj
<ex>He did.
"""
[ RNAME lver ].
v_aux-ell-xpl_dlr := vp_ellipsis_expl &
"""
Elided VP compl, expletive subj
<ex>It did.
"""
[ RNAME lvex ].
v_aux-cx-noinv_dlr := contracted_aux_noninv_lexrule &
"""
Contracted auxiliary, no subject-auxiliary inversion
<ex>Kim'll arrive.
<nex>Kim'll.
"""
[ RNAME lcx ].
v_nger-intr_dlr := intrans_nominal_gerund &
"""
Nominal gerund of intrans verb
<ex>Leaving was easy.
"""
[ RNAME lngi ].
v_nger-pp_dlr := intrans_pp_nominal_gerund &
"""
Nominal gerund of PP-comp verb
<ex>Relying on Kim was wrong.
"""
[ RNAME lngp ].
v_nger-tr_dlr := trans_nominal_gerund &
"""
Nominal gerund of trans verb
<ex>The hiring of Kim was OK.
"""
[ RNAME lngt ].
n_det-mnth_dlr := month_det_lexrule &
"""
Month name as determiner
<ex>July tenth arrived.
"""
[ RNAME lmd ].
n_det-wkdy_dlr := weekday_det_lexrule &
"""
Weekday name as determiner
<ex>We arrived Sunday morning.
"""
[ RNAME lwd ].
n_dom-ppof_dlr := dom_ppof_lexrule &
"""
Weekday name as determiner
<ex>We arrived Sunday morning.
"""
[ RNAME ldp ].
j_att_dlr := attr_adj_lexrule &
"""
Attrib adj from trans pred adj
<ex>A similar cat arrived.
"""
[ RNAME lja ].
v_j-nb-intr_dlr := attr_verb_part_lexrule &
"""
Attrib adj from intrans verb
<ex>The sleeping cat stirred.
"""
[ RNAME ljv ].
v_j-nb-prp-tr_dlr := attr_verb_part_tr_lexrule &
"""
Attr adj from trans prp verb
<ex>The admiring crowd ran.
"""
[ RNAME ljvt ].
v_j-nb-pas-tr_dlr := attr_verb_part_psv_lexrule &
"""
Attr adj from trans passive verb
<ex>The hired consultant left.
"""
[ RNAME ljvp ].
v_j-nb-pas-ptcl_dlr := attr_verb_part_ptcl_psv_lexrule &
"""
Attr adj from passive verb+selPP
<ex>The hoped for consultant left.
"""
[ RNAME ljvr ].
v_j-nme-intr_dlr := attr_verb_part_intr_namemod_lexrule &
"""
Attr adj from intr verb, nme mod, passive participle
<ex>The respected Abrams won.
"""
[ RNAME ljvn ].
v_j-nme-intr-prp_dlr := attr_verb_part_intr_namemod_prp_lexrule &
"""
Attr adj from intr verb, sing. nme mod, pres participle
<ex>The smiling Abrams won.
"""
[ RNAME ljvnp ].
#|
v_j-nme-intr-pl-prp_dlr := attr_verb_part_intr_namemod_pl_prp_lexrule &
"""
Attr adj from intr verb, plur nme mod, pres participle
<ex>We admire sparkling Ds.
"""
[ RNAME ljvnpp ].
|#
v_j-nme-tr_dlr := attr_verb_part_tr_namemod_lexrule &
"""
Attr adj from trns verb, nme mod, passive participle
<ex>Our admired Abrams smiled.
"""
[ RNAME ljnt ].
v_j-nme-tr-prp_dlr := attr_verb_part_tr_namemod_prp_lexrule &
"""
Attr adj from trns verb, sing. nme mod, pres participle
<ex>Our winning Abrams smiled.
"""
[ RNAME ljntp ].
#|
v_j-nme-tr-pl-prp_dlr := attr_verb_part_tr_namemod_pl_prp_lexrule &
"""
Attr adj from trns verb, plur. nme mod, pres participle
<ex>We admire winning Ds.
"""
[ RNAME ljntpp ].
|#
det_prt-of-agr_dlr := part_ppof_agr_constr &
"""
Partitive NP, PP-of, num agrmt
<ex>Some of us are ready.
"""
[ RNAME lpca ].
det_prt-of-nagr_dlr := part_ppof_noagr_constr &
"""
Partitive NP, PP-of, no agrmt
<ex>Each of us is ready
"""
[ RNAME lpcn ].
det_prt-nocmp_dlr := part_nocomp_constr &
"""
Partitive NP, no PP complement
<ex>Most arrived. part_nocomp
"""
[ RNAME lpn ].
v_np-prtcl_dlr := NP_particle_lexrule &
"""
Particle-NP reordering
<ex>He looked the answer up.
"""
[ RNAME lnpp ].
v_dat_dlr := dative_shift_lexrule &
"""
Dative shift alternation
<ex>They gave the book to him.
"""
[ RNAME ldat ].
v_it-cp-vp_dlr := verb_it_cp_vp_lexrule &
"""
it-subj Verb+NP to CP or VP comp
<ex>It annoyed B that we left.
"""
[ RNAME lvcv ].
j_n-minut_dlr := minute_noprep_lexrule &
"""
Integer as minute name
<ex>Ten sixteen is too late.
"""
[ RNAME lmin ].
j_n-minut-p_dlr := minute_prep_lexrule &
"""
Integer as minute name with PP comp
<ex>Sixteen to ten is too late.
"""
[ RNAME lminp ].
n_n-hour_dlr := hour_np_lexrule &
"""
hour plus NP complement
<ex>Ten sixteen is too late.
"""
[ RNAME lhour ].
v_aux-tag_dlr := tag &
"""
Tag question auxiliary
<ex>He arrived, didn't he?
"""
[ RNAME ltag ].
j_enough_dlr := enough_addition_nocomps &
"""
Adj no-comps plus enough-compl
<ex>A big enough cat arrived.
"""
[ RNAME leno ].
j_enough-wc_dlr := enough_addition_wcomp &
"""
Adj w/comps plus enough-compl, gap in VP.
<ex>The window is clear enough to see through.
"""
[ RNAME lenc ].
j_enough-wc-nogap_dlr := enough_addition_wcomp_nogap &
"""
Adj w/comps plus enough-compl, no gap in VP complement
<ex>The child was tired enough to fall asleep.
"""
[ RNAME lencn ].
j_tough_dlr := tough_adj_lexrule &
"""
Tough-adj alternation
<ex>B is tough to admire.
"""
[ RNAME ltgh ].
j_tough-compar_dlr := tough_adj_compar_lexrule &
"""
Tough-adj alternation for comparatives
<ex>B is tougher to admire than C.
"""
[ RNAME ltghc ].
;; DPF 2017-06-30 - This rule now works right for parsing, but still have to
;; figure out how to block overgeneration such as *tallly* or *uglily*
#|
j_r-i_odlr :=
%suffix (* ly) (!ty !tily)
"""
Adjective to adverb, intersective
; <ex>Kim arrived slowly.
"""
adj_to_adv_int_lexrule &
[ ND-AFF +,
RNAME ljri ].
|#
;; DPF 2021-04-07 - Constrain to exclude inverted subject "it"
;;
v_inv-quot_dlr := inverted_quote_lexrule &
"""
Main verb inversion for quoting
<ex>He left, said Kim.
"""
[ SYNSEM.LOCAL.CAT.VAL.COMPS.FIRST.--SIND.PNG.GEN animate,
RNAME linq ].
v_cp-frag_dlr := cp_frag_lexrule &
"""
Verbs of saying with fragment substituted for CP complement
<ex>Yes, said Kim.
"""
[ RNAME lcpf ].
n_n-ed_odlr :=
%suffix (* ed) (!ty !tied) (e ed) (!t!v!c !t!v!c!ced)
"""
Noun with *-ed* suffix as adj
<ex>Long-eared sheep slept.
"""
noun_adj_lexrule &
[ ND-AFF +,
RNAME lnj ].
j_n-pre_odlr :=
%prefix (* pre) (* pre-)
"""
pre- prefix on common nouns with or without hyphen
<ex>The pre-war period endured.
"""
pre_noun_adj_lexrule &
[ ND-AFF +,
RNAME ljnp ].
j_n-pre-pn_odlr :=
%prefix (* pre-)
"""
pre- prefix on proper nouns, hyphen only, and capitalized noun
<ex>The pre-Reagan period endured.
"""
pre_propn_adj_lexrule &
[ ND-AFF +,
RNAME ljnp ].
v_v-re_dlr :=
%prefix (* re) (* re-)
"""
Verb with *re-* prefix
<ex>He re-tied his shoe.
"""
v_v-re_rule &
[ RNAME lre ].
v_v-pre_dlr :=
%prefix (* pre) (* pre-)
"""
Verb with *pre-* prefix
<ex>He pre-signed the check.
"""
v_v-pre_rule &
[ RNAME lpre ].
v_v-mis_dlr :=
%prefix (* mis) (* mis-)
"""
Verb with *mis-* prefix
<ex>He mis-tied his shoe.
"""
v_v-mis_rule &
[ RNAME lmis ].
;;;
;;; _fix_me_
;;; to make this rule functional, token mapping would have to not separate off
;;; *co-* (in `derivational_prefix_tmr'). however, doing that would then mean
;;; that either (a) we provide a prefixation rule for other parts of speech too
;;; (`co-author', maybe `co-educational') or minimally adjust existing lexical
;;; entries (currently MWEs); or (b) that we create a token-level ambiguity; i
;;; hesitate doing the latter. but maybe it would not be so bad, in the end?
;;; the same problem applies to other derivational rules, of course.
;;; (13-mar-09; oe)
v_v-co_dlr :=
%prefix (* co-) (* co)
"""
Verb with *co-* prefix
<ex>He co-wrote the paper.
"""
v_v-co_rule &
[ ND-AFF + ].
v_v-un_dlr :=
%prefix (* un) (* un-)
"""
Verb with *un-* prefix
<ex>He untied his shoe.
"""
v_v-un_rule &
[ RNAME lunv ].
v_v-counter_dlr :=
%prefix (* counter) (* counter-)
"""
Verb with *counter-* prefix
<ex>He counter-signed the bill.
"""
v_v-counter_rule &
[ RNAME lctv ] .
v_v-over_dlr :=
%prefix (* over) (* over-)
"""
Verb with *over-* prefix
<ex>He over-built the porch.
"""
v_v-over_rule &
[ RNAME lovtv ].
v_v-out_dlr :=
%prefix (* out) (* out-)
"""
Verb with *out-* prefix
<ex>He out-played his opponent.
"""
v_v-out_rule &
[ RNAME lotv ].
v_v-self_dlr :=
%prefix (* self) (* self-)
"""
Verb with *self-* prefix
<ex>He was self-insured.
"""
v_v-self_rule &
[ RNAME lsfv ].
v_v-cross_dlr :=
%prefix (* cross) (* cross-)
"""
Verb with *cross-* prefix
<ex>He cross-examined the witness.
"""
v_v-cross_rule &
[ RNAME lcsv ].
v_v-under_dlr :=
%prefix (* under) (* under-)
"""
Verb with *under-* prefix
<ex>The area is under-developed
"""
v_v-under_rule &
[ RNAME luvtv ].
n_n-co_dlr :=
%prefix (* co) (* co-)
"""
Noun with *co-* prefix
<ex>Our co-teacher arrived.
"""
n_n-co_rule &
[ RNAME lnco ].
n_n-co-ni_dlr :=
%prefix (* co) (* co-)
"""
Noun with *co-* prefix, non-inflecting
<ex>Our co-derivatives group arrived.
"""
n_n-co-ni_rule &
[ RNAME lncon ].
n_n-counter_dlr :=
%prefix (* counter) (* counter-)
"""
Noun with *counter-* prefix
<ex>The counter-proposal arrived.
"""
n_n-counter_rule &
[ RNAME lctn ].
n_n-counter-ni_dlr :=
%prefix (* counter) (* counter-)
"""
Noun with *counter-* prefix, non-inflecting
<ex>The counter-narcotics team arrived.
"""
n_n-counter-ni_rule &
[ RNAME lctnn ].
n_n-mini_dlr :=
%prefix (* mini) (* mini-)
"""
Noun with *mini-* prefix
<ex>The mini-car arrived.
"""
n_n-mini_rule &
[ RNAME lctn ].
n_n-mini-ni_dlr :=
%prefix (* mini) (* mini-)
"""
Noun with *mini-* prefix, non-inflecting
<ex>The mini-car transporter arrived.
"""
n_n-mini-ni_rule &
[ RNAME lctnn ].
j_j-co_dlr :=
%prefix (* co-) (* co)
"""
Adjective with *co-* prefix
<ex>The co-educational hall opened.
"""
j_j-co_rule &
[ RNAME ljco ].
j_j-un_dlr :=
%prefix (* un-) (* un)
"""
Adjective with *un-* prefix
<ex>The unhappy cat arose.
"""
j_j-un_rule &
[ RNAME lunj ].
j_j-non_dlr :=
%prefix (* non)
"""
Adjective with *non* prefix
<ex>The nonlinear solution failed.
"""
j_j-non_rule &
[ RNAME lnnj ].
j_j-over_dlr :=
%prefix (* over-) (* over)
"""
Adjective with *over-* prefix
<ex>The over-optimistic player arrived.
"""
j_j-over_rule &
[ RNAME ljco ].
w_period_plr :=
%suffix (!. !..)
"""
Period affixed to end of word, utterance-medially
<ex>We left. They arrived.
<ex>He said "Freeze. Don't move!".
<ex>2. Buy diamands.
"""
punctuation_period_rule &
[ RNAME lpp ].
w_qmark_plr :=
%suffix (!p !p\?)
"""
Question mark affixed to word, now used only in generation
<ex>cat?
<nex>
"""
punctuation_qmark_rule &
[ RNAME lpq ].
; <nex>
; <todo>
; </type>
w_comma_plr :=
%suffix (* ,)
"""
Comma affixed to word, now used only in generation
<ex>cat,
"""
punctuation_comma_rule &
[ RNAME lpcm ].
;; DPF 22-12-31 - Allowed for cluster of italics with parentheses nested inside
;; FIX someday with more general solution for such clusters.
;;
w_italleft_plr :=
%prefix (!f ⌊/!f) (!f ❲!f) (!f ⌊/\(!f)
"""
Italics mark *⌊/* prefixed
<ex>⌊/cat
"""
punctuation_italleft_rule &
[ RNAME lpil ].
w_italright_plr :=
%suffix (!r !r/⌋) (!r !r❳) (!r !r\)/⌋)
"""
Italics mark */⌋* affixed
<ex>cat/⌋
"""
punctuation_italright_rule &
[ RNAME lpir ].
w_drop-ileft_plr :=
%prefix (!f ⌊/!f)
"""
Ignored italics mark prefixed
<ex>⌊/cats
See ErgGml page in DELPH-IN wiki for documentation
"""
punct_drop_italleft_rule &
[ RNAME lpxdl ].
w_drop-iright_plr :=
%suffix (!r !r/⌋)
"""
Ignored italics mark suffixed
<ex>cats/⌋
See ErgGml page in DELPH-IN wiki for documentation
"""
punct_drop_italright_rule &
[ RNAME lpxdr ].
w_rparen_plr :=
%suffix (!p !p\))
"""
Right parenthesis affixed for clusters where tokenizing does not separate paren
<ex>(DTD)-based
<ex>LR (LR(1)) parser
"""
w_rparen_rule &
[ RNAME lprp ].