blob: fd0664f1ddbe647d889c81f4aa30ecc57b0484a8 (
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
39
40
41
|
#!/usr/bin/env perl
#
# This file is part of moses. Its use is licensed under the GNU Lesser General
# Public License version 2.1 or, at your option, any later version.
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;
}
|