
if [ $# -ne 2 ]
then
    echo "Usage:"
    echo "        compdic-fst-add <automaton1> <automaton2>"
    echo "where"
    echo "    <automaton1> - automaton in openfst format"
    echo "    <automaton2> - automaton in openfst format containing paths to be removed from <automaton1>"
    exit 0
fi	

tempdir=`mktemp -d /tmp/compdic.XXXXXX`

automaton=$tempdir/output.fst

fstunion $1 $2 | fstrmepsilon | fstdeterminize | fstminimize | fsttopsort > $automaton
mv $automaton $1
rm -r $tempdir
