Home / Expert Answers / Computer Science / stin-2024-logic-programming-1-create-a-prolog-programme-that-accepts-a-single-sentence-as-input-pa363

(Solved): STIN 2024: LOGIC PROGRAMMING 1) Create a Prolog programme that accepts a single sentence as input ...



STIN 2024: LOGIC PROGRAMMING
1) Create a Prolog programme that accepts a single sentence as input and translate that
sentence

STIN 2024: LOGIC PROGRAMMING 1) Create a Prolog programme that accepts a single sentence as input and translate that sentence into another language, such as Malay to English. Translation should be word-by-word. Word that is not available in the fact list will remain as it is. Example: a) Malay ? English "Saya suka Prolog" translated to "I like Prolog" b) English ? Malay "I like Prolog" translated to "Saya suka Prolog" Mix Language ? Mix language c) "Saya like Prolog" translated to "I suka Prolog" 2) For the interface, use the GUI code provided. 3) Create a log file. Once the user press button [TRANSLATE], save the sentence into a file. Example: Content of log.pl original('saya suka prolog"). translated ('i like prolog"). Source code for GUI: createDictGUI- _$1 = [dig_ownedbyprolog.ws_sysmenu,ws_caption], _52= [ws_child,ws_visible,ss_center], _$3= [ws_child,ws_visible,ws_tabstop,ws_border,es_left,es_multiline,es_autohscroll,es_autovscroll], _S4= [ws_child,ws_visible,ws_tabstop,bs_pushbutton], _55= [ws_child,ws_visible,ss_left]. wdcreate( dict, "Dictionary (Malay <-> English), 483, 151, 562, 354,_$1), wccreate( (dict,10000), static, 'Enter a paragraph of sentence:, 20, 10, 520, 20, 52), wccreate( (dict,8000), edit, 20, 40, 520, 120, 53), wccreate( (dict,1000), button, TRANSLATE', wccreate( (dict,1001), button, 'CLEAR', 460, 190, 80, 30, _S4), 460, 240, 80, 30, _S4), 460, 290, 80, 30, 54), 20, 190, 430, 130, _S3), wccreate( (dict,1002), button, CLOSE", wccreate( (dict,8001), edit, ", wccreate( (dict, 10001), static, Translated as:", 20, 170, 430, 20, _$5).


We have an Answer from Expert

View Expert Answer

Expert Answer


words(saya,i). words(makan,eat). words(pisang,banana). words(oren,orange). words(minum,drink). words(suka,like). :- style_check(-singleton). tr
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe