2:- module(determiners,[semlex_det/4]). 3:- use_module(boxer(resolveDRT),[goldAntecedent/2]). 4:- use_module(boxer(categories),[rel/3]). 5:- use_module(semlib(options),[option/2]). 6
13
14
18
19semlex_det(Lemma,Index,Att-[sem:'UNK'|Att],Sem):-
20 member(Lemma,[few,most,two,three]), !,
21 Sem = lam(N,lam(P,B1:drs([],[B1:[]:duplex(Lemma,merge(B2:drs([B2:Index:X],[]),
22 app(N,X)),X,
23 app(P,X))]))).
24
25
29
30semlex_det(Lemma,Index,Att-[sem:'AND'|Att],Sem):-
31 member(Lemma,[all,each,either,any,every,most,whichever,whatever]),
32 option('--semantics',amr), !,
33 Sem = lam(N,lam(P,merge(merge(B:drs([B:[]:X,B:[]:A],[B:Index:pred(A,Lemma,a,1),
34 B:[]:rel(X,A,mod,2)]),
35 app(N,X)),app(P,X)))).
36
37semlex_det(Lemma,Index,Att-[sem:'AND'|Att],Sem):-
38 member(Lemma,[all,each,either,any,every,most,whichever,whatever]), !,
39 Sem = lam(N,lam(P,B1:drs([],[B1:[]:imp(merge(B2:drs([B2:Index:X],[]),
40 app(N,X)),
41 app(P,X))]))).
42
43
47
48semlex_det(no,Index,Att-[sem:'NOT'|Att],Sem):- !,
49 Sem = lam(N,lam(P,B1:drs([],[B1:Index:not(merge(B2:drs([B2:Index:X],[]),
50 merge(app(N,X),
51 app(P,X))))]))).
52
53
57
58semlex_det(Lemma,Index,Att-[sem:'PRX'|Att],Sem):-
59 option('--semantics',amr),
60 member(Lemma,[this,these]), !,
61 Sem = lam(N,lam(P,alfa(def,merge(B:drs([B:[]:X,B:[]:E],[B:Index:pred(E,this,a,1),B:[]:rel(X,E,mod,1)]),
62 app(N,X)),
63 app(P,X)))).
64
65semlex_det(Lemma,Index,Att-[sem:'DST'|Att],Sem):-
66 option('--semantics',amr),
67 member(Lemma,[that,those]), !,
68 Sem = lam(N,lam(P,alfa(def,merge(B:drs([B:[]:X,B:[]:E],[B:Index:pred(E,that,a,1),B:[]:rel(X,E,mod,1)]),
69 app(N,X)),
70 app(P,X)))).
71
72semlex_det(Lemma,Index,Att-[sem:'DEF'|Att],Sem):-
73 member(Lemma,[the,both]), !,
75 Sem = lam(N,lam(P,alfa(def,merge(B:drs([B:Index:X],[]),
76 app(N,X)),
77 app(P,X)))).
78
79semlex_det(Lemma,Index,Att-[sem:'PRX'|Att],Sem):-
80 member(Lemma,[this,these]), !,
82 Sem = lam(N,lam(P,alfa(def,merge(B:drs([B:Index:X],[]),
83 app(N,X)),
84 app(P,X)))).
85
86semlex_det(Lemma,Index,Att-[sem:'DST'|Att],Sem):-
87 member(Lemma,[that,those]), !,
89 Sem = lam(N,lam(P,alfa(def,merge(B:drs([B:Index:X],[]),
90 app(N,X)),
91 app(P,X)))).
92
93
97
98semlex_det(Lemma,Index,Att-[sem:'QUE'|Att],Sem):-
99 member(Lemma,[which,what]), !,
100 Sem = lam(N,lam(P,B1:drs([],[B1:[]:duplex(whq,
101 merge(B2:drs([B2:Index:X],[]),app(N,X)),
102 X,
103 app(P,X))]))).
104
105
109
110semlex_det(another,Index,Att-[sem:'ALT'|Att],Sem):-
111 \+ option('--semantics',amr), !,
113 Sem = lam(N,lam(P,alfa(def,merge(B1:drs([B1:[]:Y],[]),
114 app(N,Y)),
115 merge(merge(B2:drs([B2:Index:X],
116 [B2:[]:not(B3:drs([],[B3:[]:eq(X,Y)]))]),
117 app(N,X)),
118 app(P,X))))).
119
120
124
125semlex_det(neither,Index,Att-[sem:'NOT'|Att],Sem):- !,
126 Sem = lam(N,lam(P,B1:drs([],[B1:[]:imp(merge(B2:drs([B2:Index:X],[]),app(N,X)),
127 B3:drs([],[B3:Index:not(app(P,X))]))]))).
128
129
133
134semlex_det(my,Index,Att1-[sem:'HAS'|Att2],Sem):-
135 option('--semantics',amr), !,
136 rel(of,Att1-Att2,Relation),
137 Sem = lam(N,lam(P,alfa(pro,B1:drs([B1:[]:Y],[B1:Index:pred(Y,i,n,1)]),
138 alfa(def,merge(B2:drs([B2:[]:X],[B2:[]:rel(X,Y,Relation,1)]),
139 app(N,X)),
140 app(P,X))))).
141
142semlex_det(my,Index,Att1-[sem:'HAS'|Att2],Sem):- !,
144 rel(of,Att1-Att2,Relation),
145 Sem = lam(N,lam(P,alfa(pro,B1:drs([B1:[]:Y],[B1:Index:pred(Y,person,n,1)]),
146 alfa(def,merge(B2:drs([B2:[]:X],[B2:[]:rel(X,Y,Relation,1)]),
147 app(N,X)),
148 app(P,X))))).
149
150semlex_det(Lemma,Index,Att1-[sem:'HAS'|Att2],Sem):-
151 option('--semantics',amr),
152 member(Lemma,[your,thy]), !,
153 rel(of,Att1-Att2,Relation),
154 Sem = lam(N,lam(P,alfa(pro,B1:drs([B1:[]:Y],[B1:Index:pred(Y,you,n,1)]),
155 alfa(def,merge(B2:drs([B2:[]:X],[B2:[]:rel(X,Y,Relation,1)]),
156 app(N,X)),
157 app(P,X))))).
158
159semlex_det(Lemma,Index,Att1-[sem:'HAS'|Att2],Sem):-
160 member(Lemma,[your,thy]), !,
162 rel(of,Att1-Att2,Relation),
163 Sem = lam(N,lam(P,alfa(pro,B1:drs([B1:[]:Y],[B1:Index:pred(Y,person,n,1)]),
164 alfa(def,merge(B2:drs([B2:[]:X],[B2:[]:rel(X,Y,Relation,1)]),
165 app(N,X)),
166 app(P,X))))).
167
168semlex_det(his,Index,Att1-[sem:'HAS'|Att2],Sem):-
169 option('--semantics',amr), !,
170 goldAntecedent(Index,Att1),
171 rel(of,Att1-Att2,Relation),
172 Sem = lam(N,lam(P,alfa(pro,B1:drs([B1:[]:Y],[B1:Index:pred(Y,he,n,1)]),
173 alfa(def,merge(B2:drs([B2:[]:X],[B2:[]:rel(X,Y,Relation,1)]),
174 app(N,X)),
175 app(P,X))))).
176
177semlex_det(his,Index,Att1-[sem:'HAS'|Att2],Sem):- !,
178 goldAntecedent(Index,Att1),
179 rel(of,Att1-Att2,Relation),
180 Sem = lam(N,lam(P,alfa(pro,B1:drs([B1:[]:Y],[B1:Index:pred(Y,male,n,2)]),
181 alfa(def,merge(B2:drs([B2:[]:X],[B2:[]:rel(X,Y,Relation,1)]),
182 app(N,X)),
183 app(P,X))))).
184
185semlex_det(her,Index,Att1-[sem:'HAS'|Att2],Sem):-
186 option('--semantics',amr), !,
187 goldAntecedent(Index,Att1),
188 rel(of,Att1-Att2,Relation),
189 Sem = lam(N,lam(P,alfa(pro,B1:drs([B1:[]:Y],[B1:Index:pred(Y,she,n,1)]),
190 alfa(def,merge(B2:drs([B2:[]:X],[B2:[]:rel(X,Y,Relation,1)]),
191 app(N,X)),
192 app(P,X))))).
193
194semlex_det(her,Index,Att1-[sem:'HAS'|Att2],Sem):- !,
195 goldAntecedent(Index,Att1),
196 rel(of,Att1-Att2,Relation),
197 Sem = lam(N,lam(P,alfa(pro,B1:drs([B1:[]:Y],[B1:Index:pred(Y,female,n,2)]),
198 alfa(def,merge(B2:drs([B2:[]:X],[B2:[]:rel(X,Y,Relation,1)]),
199 app(N,X)),
200 app(P,X))))).
201
202semlex_det(its,Index,Att1-[sem:'HAS'|Att2],Sem):-
203 option('--semantics',amr), !,
204 rel(of,Att1-Att2,Relation),
205 Sem = lam(N,lam(P,alfa(pro,B1:drs([B1:[]:Y],[B1:Index:pred(Y,it,n,1)]),
206 alfa(def,merge(B2:drs([B2:[]:X],[B2:[]:rel(X,Y,Relation,1)]),
207 app(N,X)),
208 app(P,X))))).
209
210semlex_det(its,Index,Att1-[sem:'HAS'|Att2],Sem):- !,
212 rel(of,Att1-Att2,Relation),
213 Sem = lam(N,lam(P,alfa(pro,B1:drs([B1:[]:Y],[B1:Index:pred(Y,thing,n,12)]),
214 alfa(def,merge(B2:drs([B2:[]:X],[B2:[]:rel(X,Y,Relation,1)]),
215 app(N,X)),
216 app(P,X))))).
217
218semlex_det(our,Index,Att1-[sem:'HAS'|Att2],Sem):-
219 option('--semantics',amr), !,
220 rel(of,Att1-Att2,Relation),
221 Sem = lam(N,lam(P,alfa(pro,B1:drs([B1:[]:Y],[B1:Index:pred(Y,we,n,1)]),
222 alfa(def,merge(B2:drs([B2:[]:X],[B2:[]:rel(X,Y,Relation,1)]),
223 app(N,X)),
224 app(P,X))))).
225
226semlex_det(our,Index,Att1-[sem:'HAS'|Att2],Sem):- !,
228 rel(of,Att1-Att2,Relation),
229 Sem = lam(N,lam(P,alfa(pro,B1:drs([B1:[]:Y],[B1:Index:pred(Y,person,n,1)]),
230 alfa(def,merge(B2:drs([B2:[]:X],[B2:[]:rel(X,Y,Relation,1)]),
231 app(N,X)),
232 app(P,X))))).
233
234semlex_det(their,Index,Att1-[sem:'HAS'|Att2],Sem):-
235 option('--semantics',amr), !,
236 rel(of,Att1-Att2,Relation),
237 Sem = lam(N,lam(P,alfa(pro,B1:drs([B1:[]:Y],[B1:Index:pred(Y,they,n,1)]),
238 alfa(def,merge(B2:drs([B2:[]:X],[B2:[]:rel(X,Y,Relation,1)]),
239 app(N,X)),
240 app(P,X))))).
241
242semlex_det(their,Index,Att1-[sem:'HAS'|Att2],Sem):- !,
244 rel(of,Att1-Att2,Relation),
245 Sem = lam(N,lam(P,alfa(pro,B1:drs([B1:[]:Y],[B1:Index:pred(Y,thing,n,12)]),
246 alfa(def,merge(B2:drs([B2:[]:X],[B2:[]:rel(X,Y,Relation,1)]),
247 app(N,X)),
248 app(P,X))))).
249
250
254
255semlex_det(many,Index,Att-[sem:'QUA'|Att],Sem):- !,
256 Sem = lam(P,lam(Q,merge(B:drs([B:[]:X],[B:Index:pred(X,quantity,n,1)]),
257 merge(app(P,X),app(Q,X))))).
258
259semlex_det(much,Index,Att-[sem:'QUA'|Att],Sem):- !,
260 Sem = lam(P,lam(Q,merge(B:drs([B:[]:X],[B:Index:pred(X,amount,n,3)]),
261 merge(app(P,X),app(Q,X))))).
262
263
267
268semlex_det(_Lemma,Index,Att-[sem:'DIS'|Att],Sem):-
269 Sem = lam(N,lam(P,merge(merge(B:drs([B:Index:X],[]),app(N,X)),app(P,X))))