Run in project directory:
$ swipl translate.pl
Play with translations English to Hungarian:
?- translate('the boy slept', Hungarian).
Hungarian to English:
?- translate(English, 'a fiúk aludtak').
English words available:
Hungarian words available:
- What's the difference between a "lexical" and "dictionary" entries (i.e.,
Dictionary entries map to the "root" forms of words, such as "speak", "boy".
Lexical entries represent words that have may or may not have morpholgical transformations applied to them. Such as "speak" or "speaks", "boy" or "boys". All forms of valid words will satisfy at least one
lex() predicate, but only their root forms will satisfy a
This allows root words to be defined, and then their various morphological forms to be recognized or generated via rules. The alternative would be exhaustively listing every form of every valid word, which would quickly become untennable and unnecessarily redundant.