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
diff options
context:
space:
mode:
authorphikoehn <pkoehn@inf.ed.ac.uk>2012-06-26 02:38:46 +0400
committerphikoehn <pkoehn@inf.ed.ac.uk>2012-06-26 02:38:46 +0400
commit7cd83567523aba0bea371e32ae4d3282f3bbf34d (patch)
tree5730591c64c1bba085ccf6bc1e5e0970513feafa /scripts/ems/support/run-command-on-multiple-refsets.perl
parent135e38d355b4bafbb54b4fc29798da548e762a55 (diff)
minor bug fixes
Diffstat (limited to 'scripts/ems/support/run-command-on-multiple-refsets.perl')
-rwxr-xr-xscripts/ems/support/run-command-on-multiple-refsets.perl15
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/ems/support/run-command-on-multiple-refsets.perl b/scripts/ems/support/run-command-on-multiple-refsets.perl
index 7590e72a1..972f5602d 100755
--- a/scripts/ems/support/run-command-on-multiple-refsets.perl
+++ b/scripts/ems/support/run-command-on-multiple-refsets.perl
@@ -7,13 +7,18 @@ die("ERROR: syntax: run-command-on-multiple-refsets.perl cmd in out")
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";
+ if -e $in && (! -e "$in.ref0" || -e $in."0");
+die("ERROR: did not find reference '$in.ref0' or '${in}0'")
+ unless (-e "$in.ref0" || -e $in."0");
-for(my $i=0;-e "$in.ref$i";$i++) {
+for(my $i=0;-e "$in.ref$i" || -e $in.$i;$i++) {
my $single_cmd = $cmd;
- $single_cmd =~ s/mref-input-file/$in.ref$i/g;
+ if (! -e "$in.ref$i") {
+ $single_cmd =~ s/mref-input-file/$in$i/g;
+ }
+ else {
+ $single_cmd =~ s/mref-input-file/$in.ref$i/g;
+ }
$single_cmd =~ s/mref-output-file/$out.ref$i/g;
system($single_cmd);
}