Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help me about DCG in prolog!!!!!

Status
Not open for further replies.

specialk80

Technical User
Jan 10, 2009
3
TR
It is about turkish grammer,parse tree.
i have a verb like v(v(ver))-->"ver"
and inflection1 like inf1(inf1(dpast))-->"di".
inf1(inf1(dpast))-->"dI".
inf1(inf1(sim))-->"iyor".
inf1(inf1(sim))-->"Iyor".
and inflection2 like inf2(inf2(past))-->"di".
inf2(inf2(past))-->"dI".
inf2(inf2(epast))-->"mis".
inf2(inf2(epast))-->"mIs".
and i should add the inf1 and inf2 to the verb like "veriyormis".
but the rule is if inf1 is "di" or "di" inf2 can't add to the verb.

can you help me about it?
thanks in advanced.
 
actually i solve that part of problem but i need help about the same project but writing a different.
i wrote
verbal(X,Y,verbal(VI,AG))-->vi(X,Y,VI),ag(X,Y,AG).
and if i write:

?-verbal(Z,X,T,"verebilirmisim",[]).
Z = high,
X = sesli,
T = verbal(vi(vb(v(v(ver)), mode(poss)), inf1(atemp), inf2(epast)), ag(sg1))

but i need to ask like;

?-parse_verbal(verebilirmisim,Tree).
Tree=verbal(vi(vb(v(v(ver)), mode(poss)), inf1(atemp), inf2(epast)), ag(sg1))


can you help me about how i can convert verbal predicate to parse_verbal one?

thanks in advanced.
 
I think that
Code:
parse_verbal(Atom, Tree) :-
	string_to_atom(L, Atom),
	verbal(_Z, _X, Tree, L, []).
should work (in SWI-Prolog).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top