Discussions related to Visual Prolog
ajivic
Posts: 1
Joined: 7 Dec 2013 9:00

prolog code that translate a sentence.

Unread post by ajivic »

i have problem creating a prolog code that accept a sentence from user, convert to word in List, and then translate each word to another language already specified in the dictionary. e.g Malay to English.
if a word do not exist in d dictioary, then it remain thesame on the output stream.
Thank you. Any help and suggested is welcome.
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

Inspect the geographical database example

Unread post by Ferenc Nagy »

Ajivic,
Inspect the geographical database example of the PDC Prolog.
Attachments
PDC_PROLOG_GEOBASE.ZIP
(9.89 KiB) Downloaded 436 times
TIA, Regards,
Frank Nagy
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

Some more words of Geobase

Unread post by Ferenc Nagy »

Hello Ajivic,

The program I have attached to my answer does the following tasks.

It has a built-in database of the rivers and mountains of the USA.
You can ask it by English sentences like
- "Which is the longest river of the USA?"
- "How long is the Colorado?".

The program makes a list of words from your questions.
It deletes the unnecessary articles and copulas.
So the cleaned lists will be ["longest","river"]; ["long","Colorado"]; respectively.
Maybe it reorders the lists.

I recommend you inspect how it executes the simplification.

A big question remains: Is the Malay language so isolating like the English?
What happens if you put the translated words one after the other?
Will a native Malay speaker understand it?

In the case of Hungarian the answer is a definite NO.
English input:
- "Which is the longest river of the United States of America"
Word by word translation:
-"Melyik vannakja?
The copula falls out, word order changes, suffixes appear.
TIA, Regards,
Frank Nagy
Post Reply