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

find-unparseable.perl « wrappers « training « scripts - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b0d38027bfb80bc4ee4998087870b592781ab1af (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
#!/usr/bin/env perl 

use warnings;
use strict;

my $lineNum = 1;
my $countUnparseable = 0;

#open(STDIN);
while(<STDIN>)
{
    my $line = $_;
    $line = trim($line);
    my $len = length($line);
    #print $len." ";

    if ($len == 0) {
	$countUnparseable++;
	print $lineNum."\n";
    }
    else {
	#print $lineNum."\n";
    }

    $lineNum++;
}
#close(STDIN);

print STDERR "num of lines=".($lineNum-1)."\n";
print STDERR "num of unparseable=$countUnparseable\n";

sub trim($)
{
    my $string = shift;
    $string =~ s/^\s+//;
    $string =~ s/\s+$//;
    return $string;
}