Build sentence

Description

Program on knowledge base create sentence containing 5 words (article, noun, verb, article, noun)

Source: Learn prolog now!, 2001, (course available on-line)

Download

Program source code: build_sentence.pl

Listing

word(article,a).
word(article,every).
word(noun,criminal).
word(noun,'big kahuna burger').
word(verb,eats).
word(verb,likes).
 
sentence(Word1,Word2,Word3,Word4,Word5) :-
	word(article,Word1),
	word(noun,Word2),
	word(verb,Word3),
	word(article,Word4),
	word(noun,Word5).

Comments

pl/prolog/pllib/build_sentence.txt · ostatnio zmienione: 2017/07/17 08:08 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0