nlp - stuck with WordNet relations in nested list in prolog -
i approximate match using wordnet relations, there 2 items approximately match if (i) head of 1 subsumes head of other according wordnet (ii) (a) first dtr of each approximately match (b) skip on first dtr of second tree , try again
to neatly, want approxmatch , approxmatchdtrs.
[love, [peter], [susan], [in, [january]] |- [like, [peter], [susan]]
i tried solve way not working:
subsynset([] ,_). subsynset([h0 | args0], [h1 | args1]) :- wordnetsubsumes(h0, h1), subsynset(args0,args1). subsynset(l, [_ | args]):- subsynset(l, args). wordnetsubsumes(h0, h0). wordnetsubsumes(h0, h1):- \+list( s(i,_,h0,_,_,_), (hyp(i, j) -> s(j,_,hyp,_,_,_), hyp = h1 ; subsynset(hyp, h1))).
i found wordnetsubsumes check first word , not sure if check list or not in code.
by way, using sicstus prolog if there different between , swi in code.
Comments
Post a Comment