English2french

Description

Translating list of word for list of word (English, French).

Source: The Art of Prolog

Download

Program source code: english2french.pl

Listing

/*
     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

Comments

pl/prolog/pllib/english2french.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