summaryrefslogtreecommitdiff
path: root/python/tests/extractor/run.sh
blob: f44da9f810bda8a72a37a75babfb2abedc16813d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env bash

# Make sure that the sa and online extractors are producing the same (correct) output

set -x verbose

python -m cdec.sa.compile -a corpus.al.gz -b corpus.fr-en.gz -o extract >| extract.ini

cat test.in | python -m cdec.sa.extract -c extract.ini -g gold -o 2>&1 | egrep '\[X\].+\|\|\|.+\|\|\|.+\|\|\|.+\|\|\|'|sed -re 's/INFO.+://g' | ./refmt.py | LC_ALL=C sort >| rules.sort

cd gold && cat grammar.0|sed -re 's/Egiv.+(IsSingletonF=)/\1/g'|LC_ALL=C sort >| rules.sort && cd ..

diff gold/rules.sort gold-rules.sort
diff rules.sort gold-rules.sort