1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
#!/bin/sh
# skip tests
# exit 77
if [ "$1" = "--python" ]; then
exit 77
fi
TOOLDIR=../../tools/src
COMPARE_TOOL=$TOOLDIR/hfst-compare
LEXCTESTS="basic.cat-dog-bird.lexc basic.colons.lexc basic.comments.lexc
basic.empty-sides.lexc basic.escapes.lexc
basic.infostrings.lexc basic.initial-lexicon-empty.lexc
basic.multichar-symbols.lexc
basic.no-Root.lexc
basic.multi-entry-lines.lexc basic.no-newline-at-end.lexc
basic.punctuation.lexc basic.root-loop.lexc
basic.spurious-lexicon.lexc basic.string-pairs.lexc
basic.two-lexicons.lexc basic.UTF-8.lexc basic.zeros-epsilons.lexc
basic.lowercase-lexicon-end.lexc
basic.multichar-escaped-zero.lexc
hfst.weights.lexc
xre.automatic-multichar-symbols.lexc xre.basic.lexc
xre.definitions.lexc xre.months.lexc xre.nested-definitions.lexc
xre.numeric-star.lexc xre.sharp.lexc xre.quotations.lexc
xre.star-plus-optional.lexc
xre.any-variations.lexc"
# basic.end.lexc -hfst doesn't parse till end
# xre.any-variations.lexc -foma ?:? problem
# basic.multichar-symbol-with-0.lexc - hfst works fine, foma wrong
# basic.multichar-flag-with-zero.lexc - foma wrong
# create foma result
# echo "read lexc $srcdir/$f \n
# save stack test.foma.gz \n
# quit \n" > tmp-foma-script
# foma -q < tmp-foma-script
# gunzip test.foma.gz
# mv test.foma $RESULT
# rm tmp-foma-script
for f in $LEXCTESTS ; do
ORIGINAL="$f.result"
FLAGGED="$f.flag.result"
hfst-fst2fst -b -f foma $FLAGGED -o $FLAGGED.foma
echo "load $FLAGGED.foma \n
eliminate flags \n
save stack $FLAGGED.noflags.foma.gz \n
quit \n" > tmp-foma-script
foma -q < tmp-foma-script
gunzip $FLAGGED.noflags.foma.gz
hfst-fst2fst $FFLAG $FLAGGED.noflags.foma -o $FLAGGED.noflags.foma.tmp
hfst-fst2fst $FFLAG $ORIGINAL -o $ORIGINAL.tmp
echo "comparing eliminated file: $f"
if ! $COMPARE_TOOL -e -s $ORIGINAL.tmp $FLAGGED.noflags.foma.tmp ; then
echo "results differ: $f"
exit 1
fi
rm $FLAGGED.foma tmp-foma-script $FLAGGED.noflags.foma $FLAGGED.noflags.foma.tmp $ORIGINAL.tmp
done
# mv test.foma $RESULT
# rm tmp-foma-script
|