-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathroots.tdl
341 lines (286 loc) · 7.96 KB
/
roots.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
;;; -*- Mode: tdl; Coding: utf-8; -*-
;;;
;;; Copyright (c) 1994-2018
;;; Dan Flickinger, Rob Malouf, Emily M. Bender
;;; see LICENSE for conditions
;;;
;;; roots.tdl
;;;
; The instances in this file are needed by the parser to know which phrase
; types to accept as successful parses of the full input string.
;; DPF 2016-12-03 - Note that the order of definition is significant for ACE
;; (at least presently), since it checks these root symbols in the order of
;; definition, not based on the order they are listed in the config file.
root_strict := phrase &
"""
Recommended for generation
Formal edited written English, ending with clause punctuation.
<ex> We admire Oslo.
<nex> We gotta admire Oslo.
"""
[ INFLECTD +,
SYNSEM root_synsem &
[ LOCAL.CAT.HEAD verb_or_conj-s,
PUNCT.RPUNCT basic_clause_punct ],
GENRE edited,
DIALECT us,
ORTH root_orth ].
root_gen := phrase &
"""
Formal edited written English, punctuated, including both focus and passives
<ex>We admire tall trees.
<ex>Tall trees, we admire.
"""
[ INFLECTD +,
SYNSEM root_gen_synsem,
GENRE edited,
DIALECT us,
ORTH root_orth ].
root_gen_nofocus := phrase &
"""
Formal edited written English, punctuated, no focus movement
Recommended default for generation excluding focus-movement (aka topicalization)
<ex>We admire tall trees.
<nex>Tall trees, we admire.
"""
[ INFLECTD +,
SYNSEM root_gen_synsem &
[ LOCAL.CONT.ICONS.LIST *nonfocuslist* ],
GENRE edited,
DIALECT us,
ORTH root_orth ].
root_gen_nopass := phrase &
"""
Formal edited written English, punctuated, no focus movement,
also exclude passives in generation
"""
[ INFLECTD +,
SYNSEM root_synsem &
[ LOCAL [ CAT.HEAD verb_or_conj-s,
CONT.ICONS 0-dlist ],
PUNCT.RPUNCT basic_clause_punct ],
GENRE edited,
DIALECT us,
ORTH root_orth ].
root_decl := phrase &
"""
Exclude imperatives and questions (e.g. for grammar checking)
"""
[ INFLECTD +,
SYNSEM root_synsem &
[ LOCAL.CONT.HOOK.INDEX.SF prop,
PUNCT.RPUNCT clause_or_pair_or_no_punct ],
GENRE standard,
ORTH root_orth ].
root_question := phrase &
[ INFLECTD +,
SYNSEM root_synsem &
[ LOCAL.CONT.HOOK.INDEX.SF ques,
PUNCT.RPUNCT clause_or_pair_or_no_punct ],
GENRE standard,
DIALECT us,
ORTH root_orth ].
root_command := phrase &
[ INFLECTD +,
SYNSEM root_synsem &
[ LOCAL.CONT.HOOK.INDEX.SF comm,
PUNCT.RPUNCT clause_or_pair_or_no_punct ],
GENRE standard,
DIALECT us,
ORTH root_orth ].
root_informal := phrase &
"""
Nonformal written English, does not require clause punctuation.
Recommended for parsing, unless domain is all edited text
<ex>You gotta admire Oslo.
"""
[ INFLECTD +,
SYNSEM root_synsem,
GENRE standard,
ORTH root_orth ].
root_formal := phrase &
[ INFLECTD +,
SYNSEM root_synsem &
[ LOCAL.CAT.HEAD verb_or_conj-s,
PUNCT.RPUNCT basic_clause_punct ],
GENRE formal,
DIALECT us,
ORTH root_orth ].
root_spoken := phrase &
"""
Full sentences reflecting spoken phenomena
For robust spoken language phenomena, like sentence final *and*
Restrict to only CONJ cnil, since already have cl_cnj-frg_c for
*and Kim stayed*
<ex>Kim will, um, stay, and.
"""
[ INFLECTD +,
SYNSEM basic_root_synsem &
[ LOCAL [ CAT [ HEAD verb & [ VFORM fin_or_imp,
TAM indic_tam ],
MC + ],
CONJ cnil ],
PUNCT.RPUNCT comma_or_clause_or_pair_or_no_punct ],
GENRE spoken,
ORTH root_orth ].
root_spoken_frag := phrase &
"""
Fragments (not full sentences) reflecting spoken phenomena
<ex> the, um, cat
"""
[ INFLECTD +,
SYNSEM basic_root_synsem &
[ LOCAL [ CAT [ HEAD frag & [ TAM indic_tam ],
MC + ],
CONJ cnil_or_lexconj ] ],
GENRE spoken,
ORTH root_orth ].
root_inffrag := sign &
"""
Informal fragments
Fragments (not full sentences), nonformal
<ex> cats, dogs and horses
"""
[ SYNSEM root_frag_synsem,
GENRE standard,
ORTH root_orth ].
root_frag := sign &
"""
For well-formed fragments in formal genre
Fragments (not full sentences), formal written english
<ex> cats, dogs, and horses
"""
[ SYNSEM root_frag_synsem &
[ PUNCT.RPUNCT clause_or_no_punct ],
GENRE formal,
DIALECT us,
ORTH root_orth ].
root_robust_frag := sign &
"""
Robust fragments
Fragments (not full sentences), robust
<ex> when it chases dog
"""
[ SYNSEM root_frag_synsem,
GENRE robust,
ORTH root_orth ].
;; DPF 2016-08-08 - Changed HEAD verb_or_frag to just verb since we also have
;; root_robust_frag. And same for CONJ cnil_or_lexconj => cnil.
root_robust := phrase &
"""
Used when parsing in hybrid mode, to allow PCFG analyses to emerge.
"""
[ INFLECTD +,
SYNSEM root_synsem,
GENRE robust,
ORTH root_orth ].
root_robust_s := phrase &
"""
Robust sentences only
"""
[ INFLECTD +,
SYNSEM basic_root_synsem &
[ LOCAL [ CAT [ HEAD verb_or_conj-s &
[ MOD *anti_list*,
VFORM fin_or_bse_or_imp ],
VAL.SUBJ *anti_list*,
MC + ],
CONT.HOOK.INDEX.SF #sf,
CONJ cnil ],
PUNCT.RPUNCT comma_or_clause_or_pair_or_no_punct &
[ PSF #sf ] ],
GENRE robust,
ORTH root_orth ].
root_non_idiom := sign &
"""
Used to determine on which candidate root edges to not apply the idiom checks
(for efficiency)
"""
[ IDIOM - ].
;;; The following four are used for `fragmented' (in the LOGON sense) input
;;; for generator
root_phr := sign &
[ SYNSEM phr_synsem &
[ LOCAL [ CAT [ HEAD [ INV -,
TAM.MOOD indicative,
MINORS.MIN norm_rel ],
VAL [ COMPS < >,
SPR *olist* ] ],
CONJ cnil ],
NONLOC [ SLASH.LIST < >,
REL.LIST < > ],
LEX -,
PUNCT no_punctuation ],
INFLECTD +,
ORTH root_orth ].
root_lex := sign &
[ SYNSEM [ LEX +,
LOCAL [ CAT.HEAD non_frag &
[ AUX na ],
CONJ cnil ],
NONLOC.SLASH.LIST < >,
PUNCT.RPUNCT clause_or_no_punct ],
INFLECTD + ].
; DPF 09-Jan-00 - Removed MSG message from root_conj, to admit eg "or on
; Tuesday"
root_conj := sign &
[ SYNSEM [ LOCAL [ CAT.VAL.COMPS < >,
CONJ lex-conj ],
NONLOC [ SLASH.LIST < >,
REL.LIST < > ],
PUNCT no_punctuation ],
INFLECTD +,
ORTH root_orth ].
root_subord := sign &
[ SYNSEM [ LOCAL [ CAT [ HEAD prep,
VAL.COMPS < > ],
CONJ cnil ],
NONLOC [ SLASH.LIST < >,
REL.LIST < > ],
PUNCT no_punctuation ],
INFLECTD +,
ORTH root_orth ].
#|
root_robust_ques := phrase &
[ INFLECTD +,
SYNSEM basic_root_synsem &
[ LOCAL [ CAT [ HEAD verbal_or_conj-s &
[ VFORM fin,
TAM.MOOD indicative ],
MC + ],
CONT.HOOK.INDEX.SF ques,
CONJ cnil ],
PUNCT.RPUNCT comma_or_clause_or_pair_or_no_punct &
[ PSF prop-or-ques ] ],
GENRE robust,
DIALECT us,
ORTH root_orth ].
|#
root_robust_ques := phrase &
[ INFLECTD +,
SYNSEM basic_root_synsem &
[ LOCAL [ CAT [ HEAD verbal_or_conj-s &
[ VFORM fin,
TAM.MOOD indicative ],
MC + ],
CONT.HOOK.INDEX.SF ques,
CONJ cnil ],
PUNCT.RPUNCT comma_or_pair_or_no_punct &
[ PSF prop-or-ques ] ],
GENRE robust,
DIALECT us,
ORTH root_orth ].
root_bridge := phrase &
[ SYNSEM.LOCAL.CAT.HEAD bridge_head,
INFLECTD - ].
root_paraphrase := phrase &
"""
For paraphrase generation only, as for example with the reverse-appositive
rule to generate both *Kim the teacher* and *the teacher Kim* from same MRS.
"""
[ INFLECTD +,
SYNSEM root_synsem &
[ LOCAL.CONT.HOOK.INDEX.SF prop,
PUNCT.RPUNCT clause_or_pair_or_no_punct ],
GENRE paraphrase,
ORTH root_orth ].