blob: 681d251c78181fcd7617db5f801a5cfb88b4933e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/usr/bin/env perl
use warnings;
use strict;
use Getopt::Long "GetOptions";
use FindBin qw($RealBin);
if (scalar @ARGV != 4) {
die("ERROR: wrong args");
}
my $filteredPath = $ARGV[0];
my $origPath = $ARGV[1];
my $tunedPath = $ARGV[2];
my $outPath = $ARGV[3];
my $tempPath = "/tmp/moses.ini.$$";
print STDERR "filteredPath=$filteredPath \n";
print STDERR "origPath=$origPath \n";
print STDERR "tunedPath=$tunedPath \n";
print STDERR "outPath=$outPath \n";
print STDERR "tempPath=$tempPath \n";
my $cmd;
$cmd = "$RealBin/substitute-filtered-tables.perl $filteredPath < $origPath > $tempPath ";
print STDERR "cmd=$cmd \n";
system($cmd);
$cmd = "$RealBin/substitute-weights.perl $tempPath $tunedPath $outPath ";
print STDERR "cmd=$cmd \n";
system($cmd);
unlink($tempPath) or warn "ERROR: could not delete $tempPath: $!";
|