Apertium has moved from SourceForge to GitHub.
If you have any questions, please come and talk to us on #apertium on irc.freenode.net or contact the GitHub migration team.

Lttoolbox and lexc

From Apertium
(Redirected from .lexc)
Jump to: navigation, search

A .lexc file defines how morphemes in the language are joined together, morphotactics.

lttoolbox et lexc


This page describes some how lttoolbox and HFST's lexc are similar, so that people more familiar with one can get to grips more easily with the other.

[edit] Terminology

lttoolbox lexc Notes
Paradigm Continuation lexicon So each time you see LEXICON foo, think <pardef n="foo"/>
Section Root lexicon
Left Up Both left and upper correspond to surface form
Right Down Corresponds to lexical form
Symbol Multichar symbol Sequences of one or more symbol which are treated as one symbol

[edit] Example

[edit] lttoolbox

    <sdef n="n"/>
    <sdef n="pl"/>
    <sdef n="sg"/>
    <pardef n="RegNounInfl">
      <e><p><l/><r><s n="n"/><s n="sg"/></r></p></e>
      <e><p><l>s</l><r><s n="n"/><s n="pl"/></r></p></e>
  <section id="Root" type="standard">
    <e lm="cat"><i>cat</i><par n="RegNounInfl"/></e> <!-- A noun -->

And to compile and use this dictionary:

$ lt-comp lr test.dix test.bin
Root@standard 7 7

$ echo "cat" | lt-proc test.bin

$ echo "cats" | lt-proc test.bin

[edit] lexc

See also: Apertium-specific conventions for lexc




NounRoot ;


cat RegNounInfl ; ! A noun


%<n%>%<sg%>:   # ;
%<n%>%<pl%>:s   # ;

And to compile and use this dictionary:

$ hfst-lexc test.lexc -o test.gen.hfst
$ hfst-invert -i test.gen.hfst -o test.mor.hfst

$ echo "cat" | hfst-lookup test.mor.hfst 
cat	cat<n><sg>

$ echo "cats" | hfst-lookup test.mor.hfst 
cats	cat<n><pl>
Personal tools