From f10edb43ceaca8284282707097aaaebb6c1aedde Mon Sep 17 00:00:00 2001 From: Michael Denkowski Date: Mon, 7 Jan 2013 23:11:17 -0500 Subject: Rule extraction unit test --- python/tests/extractor/run.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 python/tests/extractor/run.sh (limited to 'python/tests/extractor/run.sh') diff --git a/python/tests/extractor/run.sh b/python/tests/extractor/run.sh new file mode 100755 index 00000000..f44da9f8 --- /dev/null +++ b/python/tests/extractor/run.sh @@ -0,0 +1,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 -- cgit v1.2.3