I was curious if anyone knew how to implement DCG with YieldProlog as well as Prolog assertions?
Example... given the DCG grammar here....
modifier --> [the].
noun --> [cat].
noun --> [mouse].
noun --> [polar, bear].
verb --> [chases].
verb --> [eats].
... which translates to the expanded Prolog terms of...
sentence(L1, L4) :-
subject(L1, L3) :-
object(L1, L3) :-
.... One should be able to assert new facts derived by the understanding of the grammar and parts of speach.... such as...
?- assert( chases([cat], [mouse]) ).
?- assert( eats( [polar, bear], [cat]) ).
Easy to do in Prolog... can't seem to figure out how to do it in YieldProlog.
I have an english grammar/symantec analysis system written in Mercury Prolog, which has become bloated and super slow. Yeild prolog could help out alot, if I could figure out how to construct dynamic functors, without having to invoke some .NET reflection methods and/or dynamic .NET CLR compilations.
Any help/advice/direction would be greatly appreciated.
Thanks much in advance!
Log in to post a comment.