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

run.perl « misc.mml-ignore-lines « tests - github.com/moses-smt/moses-regression-tests.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2205b4fe2f94edd006cc830c1759bb3582d4959f (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
36
37
38
39
40
41
42
43
#!/usr/bin/env perl

use warnings;
use strict;
my $script_dir; BEGIN { use Cwd qw/ abs_path /; use File::Basename; $script_dir = dirname(abs_path($0)); push @INC, $script_dir; }
use MosesRegressionTesting;
use Getopt::Long;
use File::Temp qw ( tempfile );
use POSIX qw ( strftime );

my ($mosesRoot, $mosesBin, $test_name, $data_dir, $test_dir, $results_dir);

GetOptions("moses-root=s" => \$mosesRoot,
           "moses-bin=s" => \$mosesBin,
           "test=s"    => \$test_name,
           "data-dir=s"=> \$data_dir,
           "test-dir=s"=> \$test_dir,
           "results-dir=s"=> \$results_dir,
          ) or exit 1;


my $local_config = new File::Temp( UNLINK => 0, SUFFIX => '.config' );
my $cmd;
open(CONFIG, "$test_dir/$test_name/config") || die "Failed to open config file";
open(NEWCONFIG, ">$local_config") || die "Failed to create local config";
while (<CONFIG>) {
  s,TESTDIR,$test_dir/$test_name,g;
  s,RESULTSDIR,$results_dir,g;
  print NEWCONFIG;
}
close NEWCONFIG;


$cmd = "$mosesRoot/scripts/ems/support/mml-filter.py  $local_config";
print STDERR "Executing: $cmd\n";
`$cmd`;
system("cat $results_dir/output.fr $results_dir/output.en > $results_dir/out");