// intermediate rules for sender sender1(X) :- anchor(V), location(X), before(X,V), insamesentence(X,V), not myout(X). sender2(X) :- anchor(V), organization(X), before(X,V), insamesentence(X,V), not myout(X). sender3(X) :- anchor(V), location(X), before(X,V), insamesentence(X,V), not sender1(Z). sender4(X) :- anchor(V), organization(X), before(X,V), insamesentence(X,V), not sender2(Z). sender5(X) :- anchor(V), immbefore(X,V), not sender1(W), not sender2(Y), not sender3(Z), not sender4(D). sender6(X) :- anchor(X), insamesentence(X,V), before(X,V), not myout(X), not sender1(B), not sender2(Z), not sender3(Y), not sender4(W), not sender5(T). // slot rules for sender sender(X) :- 0.8 sender1(X). sender(X) :- 0.8 sender2(X). sender(X) :- 0.7 sender3(X). sender(X) :- 0.6 sender4(X). sender(X) :- 0.6 sender5(X). sender(X) :- 0.5 sender6(X). // intermediate rules for item item1(X) :- anchor(V), after(X,V), myto(T), insamesentence(X,V), insamesentence(X,T), before(X,T). item2(X) :- anchor(V), after(X,V), insamesentence(X,V), not item1(Z). item3(X) :- anchorpass(V), insamesentence(X,V), before(X,V), not myout(X). item4(X) :- action(A)[be, were], anchorpass(V), immbefore(X,A), immbefore(A,V). item5(X) :- action(A)[were, be], anchorpass(V), before(X,A), immbefore(A,V), insamesentence(X,V). // slot rules for item item(X) :- 0.8 item1(X). item(X) :- 0.7 item2(X). item(X) :- 0.7 item3(X). item(X) :- 0.6 item4(X). item(X) :- 0.6 item5(X). // intermediate rules for receiever receiver1(X) :- anchor(V), insamesentence(X,V), after(X,V), not beforemyto(X), not afterendmark(X). receiver2(X) :- anchorpass(V), to(T), after(T,V), after(X,V), insamesentence(X,V), insamesentence(X,T). // slot rules for receiever receiver(X) :- 0.7 receiver1(X). receiver(X) :- 0.7 receiver2(X). // some additional important "landmark" tokens for this domain // most sentences are of the form .... "dispatched" .. ... "to" ... ... // mark the "to" after the anchor (i.e., 'dispatched') as 'myto' myto(X) :- firstamongst[mycandto(X)]. mycandto(X) :- to(X), anchor(V), after(X,V), insamesentence(X,V). aftermyto(X) :- myto(T), insamesentence(X,T), after(X,T). beforemyto(X) :- myto(T), insamesentence(X,T), before(X,T). // any action (verb) before the anchor // for instance ..... "the us prepared aid packages and dispatched rescue personnel to ...." // so "prepared" is an action before the anchor actionbeforeanc(X) :- anchor(V), action(X), before(X,V), insamesentence(X,V). actionbeforeanc(X) :- anchorpass(V), action(X), before(X,V), insamesentence(X,V). // any token before an actoinn before the anchor myout(X) :- actionbeforeanc(A), before(X,A). endmark(X) :- action(X), myto(T), after(X,T). endmark(X) :- comma(X), myto(T), after(X,T). afterendmark(X) :- endmark(M), after(X,M). // myaction(X) :- action(X), anchorpass(V), insamesentence(X,V), before(X,V).