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

substitute-filtered-tables-and-weights.perl « support « ems « scripts - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9c06b54f8c91271d8ac4c6433d8f35a97ca39665 (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
#!/usr/bin/env perl 

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: $!";