A basic lexicon in Prolog


A basic lexicon in Prolog


This report is concerned with creating a lexical database in Prolog, and with providing appropriate output.

Lexical Database as a Prolog Programme

Programme header


% Demo file for consulting
% consult.pl
% D. Gibbon
% 15 Jan 1998

Lexical database


% Phonemic transcription in SAMPA
lexicon('boil', 'bOIl', 'Verb', 'kochen').
lexicon('fry', 'fraI', 'Verb', 'in der Pfanne braten').
lexicon('meat', 'mi:t', 'Noun', 'Fleisch').
lexicon('potato', 'p@teItoU', 'Noun', 'Kartoffel').
lexicon('cabbage', 'k{bIdZ', 'Noun', 'Kohl').

Queries to the lexical database


allqueries :-
lexicon(Entry, Pron, POS, Gloss),
write('The word "'),
write(Entry),
write('" is an English '),
write(POS),
write(', pronounced /'),
write(Pron),
write('/ and meaning "'),
write(Gloss),
write('" in German.'),
nl,
fail.

Main executable section for Prolog query


:- tell('c:\Eigene Dateien\PrologWin95\consultdemo.txt'),
not(allqueries),
halt.

Output of the Prolog programme


The word "boil" is an English Verb, pronounced /bOIl/ and meaning "kochen" in German.
The word "fry" is an English Verb, pronounced /fraI/ and meaning "in der Pfanne braten" in German.
The word "meat" is an English Noun, pronounced /mi:t/ and meaning "Fleisch" in German.
The word "potato" is an English Noun, pronounced /p@teItoU/ and meaning "Kartoffel" in German.
The word "cabbage" is an English Noun, pronounced /k{bIdZ/ and meaning "Kohl" in German.

Conclusion and Prospects


The Prolog programme successfully implements a bilingual lexical database and presents the results in the form of English sentences.
This lexical database could in principle be used as part of an English-German translation programme.