An example
An example test lexicon:
LEXICON Root
raaka:raaKan #;
liuku:liuKun #;
Example rules as written according to the normal twolevel rule formalism:
Alphabet
a i k l n u K:%' ;
Rules
"Orig" K:%' => a _ a ;
u _ u ;
This rule set could be preprocessed into an equivalent form using two auxiliary symbols '1 and '2 :
Alphabet
a i k l n u K:%'1 K:'2 ;
Rules
"Mod1" K:%'1 => a _ a ;
"Mod2" K:%'2 => u _ u ;
In the general case, the auxiliary symbols have to be taken care of in all places where the original symbols occur. In any context, the original symbol must be replaced with the set of it and all its auxiliary versions. In all leftarrow rules where the original symbol is the right hand side of the pair, one must allow there it and all its auxiliary versions.
The modified rule set should be first composed with the lexicon and the result of this composition should be composed with a transduction which converts '1 and '2 into plain ' . The following transducer given in text format would suit the example:
0
0 0 a a
0 0 i i
0 0 k k
0 0 l l
0 0 n n
0 0 r r
0 0 u u
0 0 '1 '
0 0 '2 '
A makefile like the following would do the thing:
comptest.fst : comptestlexc.fst comptesttwolc.fst fixfst.fst Makefile
hfstcomposeintersect l comptestlexc.fst comptesttwolc.fst \
hfstcompose o comptest.fst 2 fixfst.fst
comptestlexc.fst : comptest.lexc Makefile
hfstlexc o $@ $<
comptesttwolc.fst : comptest.twolc Makefile
hfsttwolc v N o $@ $<
fixfst.fst : fixfst.txt Makefile
hfsttxt2fst e @0@ o $@ $<
Notes
 The compilation of => rules with multiple contexts requires somewhat complex formulas and appears to become computationally complex when the number of context parts increases. It is not unusual that the size of the compiled rule increases exponentially in respect with the number of contexts. Complex behaviour occurs when the contexts are relatively independent of each other, which is usually the case.
 The context resolution scheme is normally implemented as a preprocessing stage where the conflicts are detected and thereafter resolved by copying contexts to other rules. This may create rules with many contexts.
 There appears to be no obvious reason why the proposed scheme would be more complex than the present one. It could be substantially more efficient in demanding cases.
 It remains to be proven whether the construction is really equivalent with the current methods. The proposed scheme may be defective by not allowing
 free overlaps of contexts of successive occurrences
 inclusion of the centers in the contexts of other occurences
 occurrences of the centers in mixed contexts etc.
