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

filter-stderr.pl « phrase.ptable-filtering « tests - github.com/moses-smt/moses-regression-tests.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 23cd7146ed453f5502fc7486c66bdabaeb4a48dc (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
#!/usr/bin/env perl
$x=0;
while (<>) {
  chomp;

	if (/^\[.* ; 2-2\]$/o) {
    my @lines;
    my $done = 0;
    while (!$done) {
      $x = <>;
      if ($x =~ /^\s*$/o) { $done = 1; } else {
        chomp $x;
        $x =~ s/^\s+//o;
        push @lines, $x;
      }
    }
    my $c = 0;
    foreach my $x (sort @lines) {
      $c++;
      print "TRANSLATION_OPTION_$c=$x\n";
    }
  }

  next unless /^BEST TRANSLATION:/;
  s/^BEST TRANSLATION:\s*//;
  s/\s*\[111+.*$//;
  $x++;
  print "TRANSLATION_$x = $_\n";
}