diff options
author | phkoehn <phkoehn@1f5c12ca-751b-0410-a591-d2e778427230> | 2010-10-27 16:42:34 +0400 |
---|---|---|
committer | phkoehn <phkoehn@1f5c12ca-751b-0410-a591-d2e778427230> | 2010-10-27 16:42:34 +0400 |
commit | 7334d49191861f84ace29998e070b999edc46519 (patch) | |
tree | c3ac357f27273520e28abbf4d0f61ab976f5592c /scripts/ems/support | |
parent | 46b59cbdd75d8adf85d7496c16ab728f544c2195 (diff) |
minor experiment.perl fixes
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@3668 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'scripts/ems/support')
-rwxr-xr-x | scripts/ems/support/report-experiment-scores.perl | 2 | ||||
-rwxr-xr-x | scripts/ems/support/run-command-on-multiple-refsets.perl | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/scripts/ems/support/report-experiment-scores.perl b/scripts/ems/support/report-experiment-scores.perl index 29cbdea59..fddd02fb3 100755 --- a/scripts/ems/support/report-experiment-scores.perl +++ b/scripts/ems/support/report-experiment-scores.perl @@ -64,7 +64,7 @@ sub extract_nist_bleu { $bleu = $1*100 if /BLEU score = (\S+)/; $ratio = int(1000*$1)/1000 if /length ratio: (\S+)/; } - if (!$bleu) { + if (!defined($bleu)) { print STDERR "ERROR (extract_nist_bleu): could not find BLEU score in file '$file'\n"; return ""; } diff --git a/scripts/ems/support/run-command-on-multiple-refsets.perl b/scripts/ems/support/run-command-on-multiple-refsets.perl index 1a7ef9e8e..7590e72a1 100755 --- a/scripts/ems/support/run-command-on-multiple-refsets.perl +++ b/scripts/ems/support/run-command-on-multiple-refsets.perl @@ -6,6 +6,11 @@ die("ERROR: syntax: run-command-on-multiple-refsets.perl cmd in out") unless scalar @ARGV == 3; my ($cmd,$in,$out) = @ARGV; +die("ERROR: attempt to run on multiple references, but there is only one") + if -e $in && ! -e "$in.ref0"; +die("ERROR: did not find reference '$in.ref0'") + unless -e "$in.ref0"; + for(my $i=0;-e "$in.ref$i";$i++) { my $single_cmd = $cmd; $single_cmd =~ s/mref-input-file/$in.ref$i/g; |