Software Freedom Law Center

Changeset 73

Show
Ignore:
Timestamp:
04/27/08 22:17:39 (3 months ago)
Author:
bkuhn
Message:

r88@hughes: bkuhn | 2008-04-27 21:57:29 -0400

  • Fixed various typos
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/apps/pdfdiff/Perl/lib/PDF/Extract/Text.pm

    r72 r73  
    116116  my $text = $self->{ocrObj}->get_text; 
    117117  my @lines = split(/\n/, $text); 
    118   my $lines = \@lines; 
     118  my $line = \@lines; 
    119119  my $newText; 
    120120 
     
    138138  my $cutOffLen = $avgLen - 5; 
    139139  for (my $ii = 0; $ii < @lines; $ii++) { 
    140     if ($line->{$ii} =~ /\s{10,}/) { 
     140    if ($lines->[$ii] =~ /\s{10,}/) { 
    141141      # Assume that any line that starts with ten spaces or more is a 
    142142      # title, heading or other stand alone unit of some sort. 
    143       $newText .= $line->{$ii} . "\n"; 
     143      $newText .= $lines->[$ii] . "\n"; 
    144144      # Add another newline if one doesn't follow 
    145       $newText .= "\n" unless $line->{$ii+1} =~ /^\s*$/; 
     145      $newText .= "\n" unless $lines->[$ii+1] =~ /^\s*$/; 
    146146      $inPara = 0; 
    147147      next; 
    148148    } 
    149     ($line->{$ii},$line->{$ii+1}) = 
    150       $self->_handleDeHyphen($line->{$ii},$line->{$ii+1}
    151         if ($line->{$ii} =~ /\-$/); 
     149    ($lines->[$ii],$lines->[$ii+1]) = 
     150      $self->_handleDeHyphen($lines->[$ii],$lines->[$ii+1]
     151        if ($lines->[$ii] =~ /\-$/); 
    152152 
    153153    if ($curLen <= $cutOffLen) { 
    154       $newText .= $line->{$ii} . "\n"; 
     154      $newText .= $lines->[$ii] . "\n"; 
    155155      # Add another newline if one doesn't follow so the para is separated 
    156       $newText .= "\n" unless $line->{$ii+1} =~ /^\s*$/; 
     156      $newText .= "\n" unless $lines->[$ii+1] =~ /^\s*$/; 
    157157    } else { 
    158       $newText .= $line->{$ii} . " "; 
     158      $newText .= $lines->[$ii] . " "; 
    159159    } 
    160160  } 
     
    165165  my($self, $origFirstLine, $origSecondLine) = @_; 
    166166  my ($firstLine, $secondLine) = ($origFirstLine, $origSecondLine); 
    167   if ($firstLine =~ /^(.*)\s+(\S+)\-\s*$/$1/) { 
     167  if ($firstLine =~ s/^(.*)\s+(\S+)\-\s*$/$1/) { 
    168168    my $word = $2; 
    169     if ($secondLine =~ /^\s*(\S+)([\s\.\,]+.*)$/$2/) { 
     169    if ($secondLine =~ s/^\s*(\S+)([\s\.\,]+.*)$/$2/) { 
    170170      $word .= $1; 
    171171      return ("$firstLine$word", $secondLine) 

SFLC Main Page

[frdm] Support SFLC