-
Notifications
You must be signed in to change notification settings - Fork 3
/
inflr.tdl
384 lines (345 loc) · 10.4 KB
/
inflr.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
;;; -*- Mode: tdl; Coding: utf-8; -*-
%(letter-set (!c bdfgklmnprstz))
%(letter-set (!s abcdefghijklmnopqrtuvwxyz05_/.))
%(letter-set (!t bcdfghjklmnpqrstvwxyz))
%(letter-set (!v aeiou))
%(letter-set (!. abcdefghijklmnopqrstuvwxyzåøöáéíóúìµñßœæëïüÿäěʤàāēīōūABCDEFGHIJKLMNOPQRSTUVWXYZÅØÖÉÌ0Ä123456789[]\(\){}|>/_-…%`”"'’?!#+¦⌊⌋$£=σΩÅص™°º℃))
%(letter-set (!p abcdefghijklmnopqrstuvwxyzåøöáéíóúìµñßœæëïüÿäěʤàāēīōūABCDEFGHIJKLMNOPQRSTUVWXYZÅØÖÉÌ0Ä123456789,.?\![]\(\){}|>/_-%”"'’#+¦⌊⌋$£=σΩÅØ®…™°º℃β*))
%(letter-set (!q abcdefghijklmnopqrstuvwxyzåøöáéíóúìµñßœæëïüÿäěʤàāēīōūABCDEFGHIJKLMNOPQRSTUVWXYZÅØÖÉÌ0Ä123456789,.?\!\(\)[]{}|>:/_-%`”"'’#+¦⌊⌋$£=σΩ…µ™°º℃β))
;; Same as q but without italic marker, to avoid right-ital rules applying
;; without having done left-ital when needed; also exclude parens
%(letter-set (!r abcdefghijklmnopqrstuvwxyzåøöáéíóúìµñßĥŭœæëïüÿäěʤàāēīōūABCDEFGHIJKLMNOPQRSTUVWXYZÅØÖÉÌ0Ä123456789,.?\![]{}|>:/_-%`”"'’#+$£=σΩ…µ™°ºβ))
%(letter-set (!f abcdefghijklmnopqrstuvwxyzåøöáéíóúìµñßĥŭœæëïüÿäěʤàāēīōūABCDEFGHIJKLMNOPQRSTUVWXYZÅØÖÉÌ0Ä123456789[]“"‘'`#+¦⌊⌋$£=[]{}|</_\-.,Åؽ…µ™°ºβ))
;; For semicolons, which can follow periods but not commas, as in |St.;|
%(letter-set (!k abcdefghijklmnopqrstuvwxyzåøöáéíóúìµñßœæëïüÿäěʤàāēīōūABCDEFGHIJKLMNOPQRSTUVWXYZÅØÖÉÌ0Ä123456789.\![]\(\){}|>/_%”"'’#+¦⌊⌋$£=σΩÅØ®…™°ºβ*))
%(letter-set (!b \!))
;;; irregular words are stored in a separate file - irregs.tab
;;; because the forms stored there are the values of affix
;;; all the rules here should have the name `affix-type'_infl_rule
n_pl_olr :=
%suffix (!s !ss) (!ss !ssses) (es eses) (ss sses) (!ty !ties) (ch ches) (sh shes) (x xes) (z zes)
"""
Plural noun with *-s* suffix
<ex>cats
"""
n_pl_inflrule &
[ ND-AFF +,
SYNSEM mass_or_count_synsem &
[ LOCAL plur_noun & [ AGR.PNG png-reg ] ],
RNAME lnpl ].
n_pl-paren_olr :=
%suffix (!s !s\(s\))
"""
Plural noun with *-s* suffix
<ex>cats
"""
n_pl_inflrule &
[ ND-AFF +,
SYNSEM mass_or_count_synsem &
[ LOCAL plur_noun & [ AGR.PNG png-reg ] ],
RNAME lnpl ].
n_pl-irreg_olr :=
%suffix (xxirreg xxirreg)
"""
For *children, people, etc.*
"""
n_pl_inflrule &
[ ND-AFF +,
SYNSEM mass_or_count_synsem &
[ LOCAL plur_noun & [ AGR.PNG png-irreg ] ],
RNAME lnpli ].
;; DPF 2020-07-12 - NORM quantity_or_norm_rel sadly prevents these from being
;; vocatives, as in "People, let's move!". And more generally, we want to accept
;; "people mover", so we finally added a construction-specific feature --CPDNHD
;; to enable lexical blocking for compounds.
;;
n_pl-irreg-noaff_olr :=
%suffix (xxirreg xxirreg)
"""
For *fish, deer,* etc. where no change in form
"""
n_pl_inflrule &
[ ND-AFF +,
SYNSEM mass_or_count_synsem &
[ LOCAL plur_noun & [ AGR.PNG png-irreg,
CAT.HEAD.--BARE - ] ],
RNAME lnpln ].
v_3s-fin_olr :=
%suffix (!s !ss) (!ss !ssses) (ss sses) (!ty !ties) (ch ches) (sh shes) (x xes) (z zes)
"""
Third-singular present verb
<ex>admires
"""
v_3s-fin_inflrule &
[ ND-AFF +,
SYNSEM.LOCAL third_sg_fin_verb,
RNAME lvsg ].
v_psp_olr :=
%suffix (* ed) (!ty !tied) (e ed) (!t!v!c !t!v!c!ced)
"""
Past participle verb
<ex>admired
"""
v_psp_inflrule &
[ ND-AFF +,
SYNSEM.LOCAL psp_verb,
RNAME lvpp ].
v_pst_olr :=
%suffix (* ed) (!ty !tied) (e ed) (!t!v!c !t!v!c!ced)
"""
Past tense verb
<ex>admired
"""
v_pst_inflrule &
[ ND-AFF +,
SYNSEM.LOCAL past_or_subj_verb,
RNAME lvpt ].
v_prp_olr :=
%suffix (* ing) (!t!v!c !t!v!c!cing) (e ing) (ee eeing) (ie ying)
"""
Present participle verb
<ex>admiring
"""
v_prp_inflrule &
[ ND-AFF +,
SYNSEM.LOCAL prp_verb,
RNAME lvpr ].
v_prp-nf_olr :=
%suffix (* in) (!t!v!c !t!v!c!cin) (e in) (ee eein) (ie yin)
"""
Present participle verb,nonformal
Non-standard variant for *tryin* and *tryin'*
<ex>admirin
"""
v_prp-nf_inflrule &
[ ND-AFF +,
SYNSEM.LOCAL prp_verb,
RNAME lvprn,
GENRE nonformal ].
#|
bse_verb_irule := lex_rule_infl_affixed &
[ ND-AFF -,
ORTH #stem,
DTR [ ORTH #stem ],
SYNSEM.LOCAL bse_verb,
RNAME lvbs ].
non_third_sg_fin_verb_irule := lex_rule_infl_affixed &
[ ND-AFF -,
ORTH #stem,
DTR [ ORTH #stem ],
SYNSEM.LOCAL non_third_sg_fin_verb,
RNAME lvns ].
|#
v_n3s-bse_ilr := v_n3s-bse_inflrule &
"""
Non-3sing or base form verb
<ex>admire
"""
[ ND-AFF -,
ORTH #stem,
DTR [ ORTH #stem ],
SYNSEM.LOCAL bse_or_non3sg_verb,
RNAME lvns ].
n_sg_ilr := n_sg_inflrule &
"""
Singular noun
<ex>cat
"""
[ ND-AFF -,
ORTH #stem,
DTR [ ORTH #stem ],
SYNSEM count_noun_synsem & [ LOCAL sing_noun & [ AGR.PNG norm-png ] ],
RNAME lnsg ].
n_ms_ilr := n_ms_inflrule &
"""
Mass noun
<ex>rice
"""
[ ND-AFF -,
ORTH #stem,
DTR [ ORTH #stem ],
SYNSEM basic_basic_mass_noun_synsem & [ LOCAL mass_noun ],
RNAME lnms ].
n_ms-cnt_ilr := n_ms-cnt_inflrule &
"""
Mass or count noun
<ex>[unknown noun]
"""
[ ND-AFF -,
ORTH #stem,
DTR [ ORTH #stem ],
SYNSEM basic_mass_or_count_synsem & [ LOCAL mass_count_noun ],
RNAME lnmc ].
n_pl-cur_ilr := n_pl-cur_inflrule &
"""
Plural of currency noun: no *-s*
<ex>the $2 book
"""
[ ND-AFF -,
ORTH #stem,
DTR n_-_c-cur_le & [ ORTH #stem ],
SYNSEM.LOCAL plur_noun,
RNAME lnpn ].
n_sg-cur_ilr := n_sg-cur_inflrule &
"""
Singular of currency noun: INFLECTD na_or_+
<ex>the $1 book
Added rule so we can get *the $1 book* where N-N cmpnd rule
excludes INFLECTD +.
"""
[ ND-AFF -,
ORTH #stem,
DTR n_-_c-cur_le & [ ORTH #stem ],
SYNSEM.LOCAL sing_noun & [ AGR.PNG png-unsp ],
RNAME lnsn ].
#|
v_pas_odlr :=
%suffix (* ed) (!ty !tied) (e ed) (!t!v!c !t!v!c!ced)
"""
Passive verb
<ex>admired
"""
v_pas-norm_lexrule &
[ ND-AFF +,
DTR.SYNSEM trans_subst &
[ LOCAL [ CAT.VAL.COMPS [ FIRST [ LOCAL.CONT #objcont,
--SIND #objind,
NONLOC [ SLASH.LIST #slash,
REL.LIST #rel,
QUE.LIST #que ] ],
REST #comps ] ],
LKEYS.KEYREL #keyrel ],
SYNSEM [ LOCAL [ CAT [ VAL [ SUBJ < [ LOCAL.CONT #objcont,
--SIND #objind,
NONLOC [ SLASH.LIST #slash,
REL.LIST #rel,
QUE.LIST #que ] ] >,
COMPS.REST #comps ] ],
CONT [ HOOK.XARG #objind ] ],
LKEYS.KEYREL #keyrel ],
RNAME lvpa ].
|#
v_pas_odlr :=
%suffix (* ed) (!ty !tied) (e ed) (!t!v!c !t!v!c!ced)
"""
Passive verb
<ex>admired
"""
v_pas-norm_lexrule &
[ ND-AFF +,
DTR.SYNSEM trans_subst &
[ LOCAL [ CAT.VAL.COMPS [ FIRST [ LOCAL.CONT #objcont,
--SIND #objind ],
REST #comps ] ],
LKEYS.KEYREL #keyrel ],
SYNSEM [ LOCAL [ CAT [ VAL [ SUBJ < [ LOCAL.CONT #objcont,
--SIND #objind ] >,
COMPS.REST #comps ] ],
CONT [ HOOK.XARG #objind ] ],
LKEYS.KEYREL #keyrel ],
RNAME lvpa ].
v_pas-p_odlr :=
%suffix (* ed) (!ty !tied) (e ed) (!t!v!c !t!v!c!ced)
"""
Prepositional passive verb
<ex>referred to
<ex>X was often referred to
"""
prep_passive_verb_lexrule &
[ ND-AFF +,
RNAME lvpe ].
v_pas-p-p_odlr :=
%suffix (* ed) (!ty !tied) (e ed) (!t!v!c !t!v!c!ced)
"""
Particle + prepositional passive verb
<ex>done away with
<ex>X was done away with
<nex>
"""
ptcl_prep_passive_verb_lexrule &
[ ND-AFF +,
RNAME lvppe ].
v_pas-p-t_odlr :=
%suffix (* ed) (!ty !tied) (e ed) (!t!v!c !t!v!c!ced)
"""
Prep. passive of trans. verb
<ex>added to
<ex>X has been added to
"""
prep_passive_trans_verb_lexrule &
[ ND-AFF +,
RNAME lvpf ].
v_pas-prt-t_odlr :=
%suffix (* ed) (!ty !tied) (e ed) (!t!v!c !t!v!c!ced)
"""
Passive of verb+sel_PP
<ex>relied on
"""
prep_passive_ptcl_verb_lexrule &
[ ND-AFF +,
RNAME lvpg ].
v_pas-cp_odlr :=
%suffix (* ed) (!ty !tied) (e ed) (!t!v!c !t!v!c!ced)
"""
Passive of cp-complement verb
<ex>said
<ex>it was believed (by many) that Sandy left
"""
v_pas-cp_lexrule &
[ ND-AFF +,
DTR.SYNSEM cp_passivable_verb &
[ LOCAL.CAT.VAL [ COMPS #comps,
KCMP #kcmp ] ],
SYNSEM passive_atrans_synsem &
[ LOCAL.CAT [ VAL [ COMPS.REST #comps,
KCMP #kcmp ] ] ],
RNAME lvcp ].
v_pas-dat_odlr :=
%suffix (* ed) (!ty !tied) (e ed) (!t!v!c !t!v!c!ced)
"""
Passive of dative shift verb
<ex>given
"""
basic_passive_verb_lexrule &
[ ND-AFF +,
DTR [ SYNSEM basic_ditrans_subst &
[ LOCAL [ CAT.VAL [ SUBJ < [ --SIND #subjind,
NONLOC #snonloc ] >,
COMPS < [ LOCAL.CONT #objcont,
--SIND #objind,
NONLOC #ononloc ],
#npcomp > ] ],
NONLOC #nonloc,
LKEYS.KEYREL #keyrel ] ],
SYNSEM [ LOCAL [ CAT [ VAL [ SUBJ < [ LOCAL.CONT #objcont,
--SIND #objind,
NONLOC #snonloc ] >,
COMPS < #npcomp,
synsem &
[ LOCAL local &
[ CAT [ HEAD prep &
[ MINORS.MIN _by_p_cm_rel ],
VAL [ SUBJ < >,
SPR *olist*,
COMPS < > ],
--SLPASS + ],
CONT.HOOK [ LTOP #ltop,
INDEX #subjind ] ],
NONLOC #ononloc,
OPT + ] > ] ],
CONT [ HOOK [ LTOP #ltop,
XARG #objind ] ] ],
NONLOC #nonloc,
LKEYS.KEYREL #keyrel ],
RNAME lvdp ].
; "X was made an example of"
v_pas-np-p_odlr :=
%suffix (* ed) (!ty !tied) (e ed) (!t!v!c !t!v!c!ced)
"""
NP + prepositional passive verb
<ex>made an example of
<ex>X was made an example of
"""
np_prep_passive_verb_lexrule &
[ ND-AFF +,
RNAME lvppn ].