While Esperanto is often charged with being too strongly based on Romance languages, it has also helped inspire Latine Sine Flexione, Interlingua and several other languages whose inventors believe strongly that Esperanto isn't Romance enough. Despite predictions that non-Indo-Europeans would never accept it, China and Japan are relative Esperanto strongholds. It has been accused of being ``too inflected'' although in formal linguistic terms it is not an inflecting language at all but is almost purely agglutinating. Language construction is definitely one of those activities where you can't please everyone. In any case, whatever anyone thinks of it as a viable human language, Esperanto's simplicity and regularity make a perfect subject for initial exercises in lexc we can model much of the language without any twolc or replace rules at all.
In this exercise, you will use lexc to model a portion of the Esperanto noun system. The facts of the noun sublanguage have been limited to keep the exercise easily manageable. If you know some Esperanto, don't worry too much right now about the gaps and overgeneration---some of them will be fixed in future exercises.
| hund | ("dog") | kat | ("cat") | bird | ("bird") | elefant | ("elefant") |
| ! Esperanto lexicon Multichar_Symbols +Acc ! accusative +Aug ! augmentative +Dim ! diminutive +Fem ! feminine +Noun ! noun +NSuff ! noun suffix +Pl ! plural j +Sg ! singular |
| LEXICON Root Nouns ; |
| LEXICON Nouns bird Nmf; hund Nmf; kat Nmf; elefant Nmf; |
After creating the source file, invoke lexc with the lexc command from the command line:
| % lexc |
| lexc> compile-source esperanto.lexc |
| lexc> lookup NOTE: Using SOURCE. Word: elefantoj elefant+Noun+NSuff+Pl |
The best way to do a systematic test is to use the check-all command. However, in order to do that, you need both a "source" and a "result". To get a result, you need to compose the the compiled source network with some rule transducer(s). Because we are assuming here that there are no morphological alternations in Esperanto, the appropriate transducer is the universal identity relation, which you can compile in xfst or in twolc from the regular expression [ ?* ].
Having compiled and saved the trivial rule transducer, load it with the command read-rules. Then apply it to the source network with the command compile-result. You are now ready to use check-all.
The output from the check-all operation is controlled by three flags: singles, duplicates, and failures. The default setting for singles is OFF. You should toggle it ON:
| lexc> singles (check-all) Singles is ON. |
Although your lexicon is infinite, don't worry, check-all is clever enough not to go to an infinite loop. Here is what you should see:
| lexc> check-all SWITCHES: singles=ON, duplicates=ON, failures=ON, ambiguities=OFF. Output file (- = stdout) [cancel]: - ================================================================== Wed Feb 11 18:08:39 1998 SOURCE: esperanto.lexc RESULT: esperanto.lexc+identity.fst SWITCHES: singles=ON, duplicates=ON, failures=ON, ambiguities=OFF. OBEY-FLAGS: ON ================================================================== bird+Noun+NSuff+Pl birdoj bird+Noun+NSuff+Pl+Acc birdojn bird+Noun+NSuff+Sg birdo bird+Noun+NSuff+Sg+Acc birdon elefant+Noun+NSuff+Pl elefantoj elefant+Noun+NSuff+Pl+Acc elefantojn elefant+Noun+NSuff+Sg elefanto elefant+Noun+NSuff+Sg+Acc elefanton hund+Noun+NSuff+Pl hundoj hund+Noun+NSuff+Pl+Acc hundojn hund+Noun+NSuff+Sg hundo hund+Noun+NSuff+Sg+Acc hundon kat+Noun+NSuff+Pl katoj kat+Noun+NSuff+Pl+Acc katojn kat+Noun+NSuff+Sg kato kat+Noun+NSuff+Sg+Acc katon Source word count: 16 (actually, infinite) Single: 16, Multiple: 0, Failure: 0 Output word count: 16 |
Because check-all is determined not to go to a loop, it does not follow arcs that lead to a state that is already on the current path. In the case at hand, we do not see any of the optional in, eg, and et suffixes in the check-alloutput. You have to verify them "manually":
| lexc> lookup elefantinetoj Use (s)ource or (r)esult? [r]: NOTE: Using RESULT. elefant+Noun+Fem+Dim+NSuff+Pl |
| tigr | ("tiger") |
| best | ("animal") |
| leon | ("lion") |