Różnice
Różnice między wybraną wersją a wersją aktualną.
|
|
pl:prolog:pllib:english2french [2019/06/27 15:50] |
pl:prolog:pllib:english2french [2019/06/27 15:50] (aktualna) |
| ====== English2french ====== |
| {{tag>knowledge_base language}} |
| ===== Description ===== |
| Translating list of word for list of word (English, French). |
| |
| **Source**: The Art of Prolog |
| ===== Download ===== |
| Program source code: {{english2french.pl}} |
| ===== Listing ===== |
| <code prolog> |
| /* |
| translate(Words,Mots) :- |
| Mots is a list of French words that is the |
| translation of the list of English words Words. |
| */ |
| translate([Word|Words],[Mot|Mots]) :- |
| dict(Word,Mot), translate(Words,Mots). |
| translate([],[]). |
| |
| dict(the,le). |
| dict(dog,chien). |
| dict(chases,chasse). |
| dict(cat,chat). |
| |
| % Program 7.8 Translating word for word |
| </code> |
| ===== Comments ===== |
| |