mosesdecoder/scripts/generic/reverse-alignment.perl
2012-05-17 17:59:48 +01:00

21 lines
344 B
Perl
Executable File

#!/usr/bin/perl -w
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";
}