Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mert
diff options
context:
space:
mode:
authorTetsuo Kiso <tetsuo-s@is.naist.jp>2011-11-15 05:17:00 +0400
committerTetsuo Kiso <tetsuo-s@is.naist.jp>2011-11-15 05:17:00 +0400
commit1ba9a4e86847626a459b8f886f9d5868ee122b61 (patch)
tree23982c226863ff2ba1acfac0f5d65917a8343e33 /mert
parent9b8cb6a6d44700b3a24de4244799ee0d07a55b3a (diff)
Add error checking for file existence.
Diffstat (limited to 'mert')
-rwxr-xr-xmert/example/memcheck_extractor.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/mert/example/memcheck_extractor.sh b/mert/example/memcheck_extractor.sh
index 1597af849..ac613da25 100755
--- a/mert/example/memcheck_extractor.sh
+++ b/mert/example/memcheck_extractor.sh
@@ -4,5 +4,13 @@ extractor=../extractor
VALGRIND_OPTS="--leak-check=full --leak-resolution=high \
--show-reachable=yes --track-origins=yes"
VALGRIND="valgrind $VALGRIND_OPTS"
+
+for datafile in NBEST REF.0 REF.1 REF.2; do
+ if ! [ -f $datafile ]; then
+ echo "Error: $datafile does not exist."
+ exit 1
+ fi
+done
+
$VALGRIND $extractor --nbest NBEST --reference REF.0,REF.1,REF.2 \
--ffile FEATSTAT --scfile SCORESTAT --sctype BLEU