This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/Logtalk/examples/dcgs/sentence.lgt

23 lines
337 B
Plaintext
Raw Normal View History

:- object(sentence,
implements(parsep),
imports(determiners, nouns, verbs)).
parse(List, true) :-
phrase(sentence, List).
parse(_, false).
sentence --> noun_phrase, verb_phrase.
noun_phrase --> ::determiner, ::noun.
noun_phrase --> ::noun.
verb_phrase --> ::verb.
verb_phrase --> ::verb, noun_phrase.
:- end_object.