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

reverse-alignment.perl « generic « scripts - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fc8c33dffac96b0f01c1e9411b060dcc9e4d7f74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env perl 

use strict;

my $line;
while ($line = <STDIN>)
{
  chomp($line);
  my @toks = split(/ /, $line);
  
  foreach (my $i = 0; $i < @toks; ++$i)
  {
    my $tok = $toks[$i];
    my @alignPair = split(/-/, $tok);
    (@alignPair == 2) or die("Something wrong");
    print $alignPair[1]."-".$alignPair[0]." ";
  }
  print "\n";
}