Minor fixes to normalize text.
This commit is contained in:
parent
b218c0846a
commit
121f5d5608
1 changed files with 6 additions and 1 deletions
7
normalize-text.plx
Normal file → Executable file
7
normalize-text.plx
Normal file → Executable file
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
# Text.pm -*- Perl -*-
|
# Text.pm -*- Perl -*-
|
||||||
#
|
#
|
||||||
# Copyright (C) 2008, 2011 Bradley M. Kuhn.
|
# Copyright (C) 2008, 2011 Bradley M. Kuhn.
|
||||||
|
|
@ -60,7 +61,7 @@ sub getText {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
($lines->[$ii],$lines->[$ii+1]) =
|
($lines->[$ii],$lines->[$ii+1]) =
|
||||||
$self->_handleDeHyphen($lines->[$ii],$lines->[$ii+1])
|
_handleDeHyphen($lines->[$ii],$lines->[$ii+1])
|
||||||
if ($lines->[$ii] =~ /\-$/);
|
if ($lines->[$ii] =~ /\-$/);
|
||||||
|
|
||||||
$curLen = length($lines->[$ii]); # May have changed
|
$curLen = length($lines->[$ii]); # May have changed
|
||||||
|
|
@ -101,3 +102,7 @@ while (my $line = <>) {
|
||||||
$data .= $line;
|
$data .= $line;
|
||||||
}
|
}
|
||||||
print getText($data);
|
print getText($data);
|
||||||
|
###############################################################################
|
||||||
|
# Local variables:
|
||||||
|
# compile-command: "perl -c normalize-text.plx"
|
||||||
|
# End:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue