-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathroots.tdl
200 lines (157 loc) · 5.94 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
;;; -*- Mode: TDL; Coding: utf-8 -*-
;===============================================================================
; LMC (2020.03.16)
; This file defines the root conditions used in ZHONG;
; These include: roots strict for education; roots strict for generation;
; normal root conditions for Mandarin; etc.
;
; This file needs to be loaded in the grammar config, and then each root type
; needs to be listed in ACE's config. Because of this, there shouldn't exist
; multiple root.tdl files.
;===============================================================================
;===============================================================================
; A sample start symbol: Accept fully-saturated verbal
; projections only; if a grammar makes use of the head-subject and
; head-complement types as provided by the Matrix, this should be a
; good starting point. Note that it is legal to have multiple start
; symbols, but they all need to be listed as the value of
; `*start-symbol' (see `lkb/user-fns.lsp').
;===============================================================================
; It seems that there is order in the roots when they are added in the ACE
; config file
;===============================================================================
; MAIN ROOT CONDITIONS
;===============================================================================
root := phrase &
"""
ZZF FB 6-4-2016 taking out 'rp' so PP and ADVP won't be S
"""
[ SYNSEM [ LOCAL [ COORD -,
CAT [ VAL [ SUBJ < >,
COMPS < > ],
MC +,
HEAD +vjpc &
[ FORM finite ] ] ],
NON-LOCAL [ SLASH 0-dlist & [ LIST < > ],
QUE 0-dlist & [ LIST < > ] ] ] ].
root-style-strict := phrase &
"""
This root is essentially the same as root, but it enforces STYLE to be strict.
FIXME: This is likely for generation purposes, should make sure and be clear.
"""
[ STYLE strict,
SYNSEM [ LOCAL [ COORD -,
CAT [ VAL [ SUBJ < >,
COMPS < > ],
MC +,
HEAD +vjpc &
[ FORM finite ] ] ],
NON-LOCAL.SLASH 0-dlist]].
frag := phrase &
"""
This root allows fragments; these should also probably be considered
ungrammatical for educational purposes;
"""
[ SYNSEM [ LOCAL [ CAT [ HEAD fragment_head,
VAL [ SUBJ < >,
SPR < >,
COMPS < > ] ] ],
NON-LOCAL.SLASH 0-dlist ] ].
lex-root := word-or-lexrule
"""
This root condition is mostly useful only for debuging purposes.
It allows you to parse single words as stand-alone utterances.
"""
.
root-utterance := utterance-phrase
"""
A very old comment mentions utterance-phrase as marking
utterances for dialogue constraints such as honorifications.
This was created by SSH and tries to add addressors and
addressees into ICONS. This is not in use at the moment.
"""
.
;===============================================================================
; ROOTS FOR EDUCATION
;===============================================================================
root_strict_adj := phrase &
"""
This root is enforing that ADJ-predicates MUST have empty SPR;
As they always come with the option of 1 (and only 1), this will block both
multiple degree specifiers and sentences with bare adj-predicates;
<ex>她 很 漂亮 。
<nex>她 漂亮 。
"""
[ SYNSEM [ LOCAL [ COORD -,
CAT [ VAL [ SUBJ < >,
COMPS < >,
SPR < >],
MC +,
HEAD adj &
[ FORM finite ] ] ],
NON-LOCAL [ SLASH 0-dlist & [ LIST < > ],
QUE 0-dlist & [ LIST < > ] ] ] ].
root_strict_vpc := phrase &
"""
This root is similar root_strict_adj, but allows verbs, conjunctions and
prepositions to head a sentence. Contrary to root_strict_adj, it does not
enforce SYNSEM.LOCAL.CAT.VAL.SPR to be empty;
This root condition is allowing was allowing 'np-time-adp' to be strict roots because the head of all 'np-adp-phrase' is preposition. Forcing [MOD < >] rules out other things from being 'strict', like sentences headed by conjunctions that didn't satisfy this MOD requirement. However, this would still be consistent with the ERG, in treating sentences like 'But he is happy.' as fragments. So, we're trying.
"""
[ SYNSEM [ LOCAL [ COORD -,
CAT [ VAL [ SUBJ < >,
COMPS < > ],
MC +,
HEAD +vpc &
[ FORM finite,
MOD < > ] ] ],
NON-LOCAL [ SLASH 0-dlist & [ LIST < > ],
QUE 0-dlist & [ LIST < > ] ] ] ].
root_rbst_frag := phrase &
"""
This root allows fragments; this should be considered 'robust' for educational purposes;
But this is important to have when treebanking.
"""
[ SYNSEM [ LOCAL [ CAT [ HEAD fragment_head,
VAL [ SUBJ < >,
SPR < >,
COMPS < > ] ] ],
NON-LOCAL.SLASH 0-dlist ] ].
root_ques_nospr_adj := phrase &
"""
<nex> 她 漂亮 吗 ?
"""
[ SYNSEM [ LOCAL [ COORD -,
CAT [ VAL [ SUBJ < >,
COMPS < >,
SPR < [] >],
MC +,
HEAD adj &
[ FORM finite ] ],
CONT.HOOK.INDEX.SF ques ],
NON-LOCAL [ SLASH 0-dlist & [ LIST < > ],
QUE 0-dlist & [ LIST < > ] ] ] ].
root_rbst_nospr_adj := phrase &
"""
This root is enforing that ADJ-predicates MUST have empty SPR;
As they always come with the option of 1 (and only 1), this will block both
multiple degree specifiers and sentences with bare adj-predicates;
We also say that this is only a problem in propositions (i.e. not questions)
<ex>她 很 漂亮 。
<nex>她 漂亮 。
"""
[ SYNSEM [ LOCAL [ COORD -,
CAT [ VAL [ SUBJ < >,
COMPS < >,
SPR < [] >],
MC +,
HEAD adj &
[ FORM finite ] ],
CONT.HOOK.INDEX.SF prop ],
NON-LOCAL [ SLASH 0-dlist & [ LIST < > ],
QUE 0-dlist & [ LIST < > ] ] ] ].
; FIXME: Why is this commented out? Should it be removed?
; SSH 2014-10-31 This root type should be used for only robust parsig.
; This cannot be used for generation.
; root-bridge := phrase &
; [ SYNSEM.LOCAL.CAT.HEAD bridge-head & [ BRIDGED + ] ].