Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

pl:prolog:pllib:english2french [2019/06/27 15:50]
pl:prolog:pllib:english2french [2019/06/27 15:50] (aktualna)
Linia 1: Linia 1:
 +====== 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 =====
  
pl/prolog/pllib/english2french.txt · ostatnio zmienione: 2019/06/27 15:50 (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