mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-30 23:42:30 +03:00
32 lines
563 B
Perl
Executable File
32 lines
563 B
Perl
Executable File
#!/usr/bin/perl
|
|
|
|
#retain lines in clean.lines-retained.1
|
|
use strict;
|
|
use warnings;
|
|
|
|
binmode(STDIN, ":utf8");
|
|
binmode(STDOUT, ":utf8");
|
|
binmode(STDERR, ":utf8");
|
|
|
|
my $retainPath = $ARGV[0];
|
|
|
|
open(LINE_RETAINED, $retainPath);
|
|
my $retainLine = <LINE_RETAINED>;
|
|
|
|
my $lineNum = 0;
|
|
while (my $line = <STDIN>) {
|
|
chomp($line);
|
|
++$lineNum;
|
|
|
|
if ($retainLine == $lineNum) {
|
|
print "$line\n";
|
|
if ($retainLine = <LINE_RETAINED>) {
|
|
# do nothing
|
|
}
|
|
else {
|
|
# retained lines is finished.
|
|
$retainLine = 0;
|
|
}
|
|
}
|
|
}
|