Różnice
Różnice między wybraną wersją a wersją aktualną.
|
|
pl:prolog:pllib:sentence [2019/06/27 15:50] |
pl:prolog:pllib:sentence [2019/06/27 15:50] (aktualna) |
| ====== Sentence ====== |
| {{tag>language}} |
| ===== Description ===== |
| Finding parts of speech in a sentence |
| |
| **Source**: The Art of Prolog |
| ===== Download ===== |
| Program source code: {{sentence.pl}} |
| ===== Listing ===== |
| <code prolog> |
| /* |
| verb(Sentence,Verb) :- |
| Verb is a verb in the list of words Sentence. |
| */ |
| |
| verb(Sentence,Word) :- member(Word,Sentence), verb(Word). |
| noun(Sentence,Word) :- member(Word,Sentence), noun(Word). |
| article(Sentence,Word) :- member(Word,Sentence), article(Word). |
| |
| /* Vocabulary */ |
| |
| noun(man). noun(woman). |
| article(a). verb(loves). |
| |
| % Program 14.1: Finding parts of speech in a sentence |
| </code> |
| ===== Comments ===== |
| |