Given an xfst script file like the following:
read lexc @srcdir@/stems/verbstems.lexc
define Stems ;
read lexc @srcdir@/affixes/verb_inner_affixes.lexc
define InnerAffixes ;
read lexc @srcdir@/affixes/verb_middle_affixes.lexc
define MiddleAffixes ;
read lexc @srcdir@/affixes/verb_outer_affixes.lexc
define OuterAffixes ;
hfst-lexc responds like this:
Using default output format OpenFst with tropical weight class
Using OpenFst's tropical weights as output
Reading from standard input...
Root...1 Verbstems...18 INTR-0-IPFV...1 INTR-0i-IPFV...1 INTR-ni-IPFV...1 INTR-ni-PFV...1 INTR-sii-PFV...1 INTR-yi-y-PFV...1 INTR-yi-a-PFV...1 INTR-yi-PROG...1 INTR-yii-PROG...1 INTR-yii-POT...1 Verbsuffixes...Warning: Sublexicons defined but not used
INTR-yi-a-PFV
Morphotaxing... # Morphotaxing... INTR-0-IPFV Morphotaxing... INTR-0i-IPFV Morphotaxing... INTR-ni-IPFV Morphotaxing... INTR-ni-PFV Morphotaxing... INTR-sii-PFV Morphotaxing... INTR-yi-PROG Morphotaxing... INTR-yi-a-PFV Morphotaxing... INTR-yi-y-PFV Morphotaxing... INTR-yii-POT Morphotaxing... INTR-yii-PROG Morphotaxing... Root Morphotaxing... Verbstems Morphotaxing... Verbsuffixes
Inserting regular expressions...
? bytes. 208 states, 224 arcs, ? paths
hfst[1]: Defined 'Stems'
hfst[0]: <unnamed>:190.1-13: Sublexicon defined more than once.: [near: `LEXICON Root']
error compiling file in lexc format
hfst[0]: Empty stack.
hfst[0]: <unnamed>:202.1-13: Sublexicon defined more than once.: [near: `LEXICON Root']
error compiling file in lexc format
hfst[0]: Empty stack.
hfst[0]: <unnamed>:211.1-13: Sublexicon defined more than once.: [near: `LEXICON Root']
error compiling file in lexc format
hfst[0]: Empty stack.
Expected outcome:
Each lexc file read and compiled on its own, returning one fst on the stack for each lexc file.
For an example language, check out SRS in the Giella infra:
svn co https://gtsvn.uit.no/langtech/trunk/startup-langs/srs
cd srs
./autogen.sh
./configure --with-hfst --without-xfst # ./configure is enough if the Xerox tools are not installed
cd src/morphology
make verbs
Yeah, while I made lexc's library version somewhat callable, it wasn't designed to be re-usable, so whoever wants to fix it will probably want to create a reset function that cleans things up.