Changeset 110

Show
Ignore:
Timestamp:
11.12.2006 21:42:08 (2 years ago)
Author:
jorge
Message:

Fixed: Change spaces to underscores when saving images, otherwise it will break scanset processsing
Change: Sort Scansets in get_scansets (FuzzyOcr/Config?.pm) and remove sorting code from FuzzyOcr?.pm

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/devel/FuzzyOcr.pm

    r109 r110  
    268268        } 
    269269 
     270        #Translate spaces to underscores, otherwise will break $input later on. 
     271        $imgfilename =~ s/ /_/g; 
     272 
    270273        #Save important constants 
    271274        $imgfiles{$filename}{fname} = $fname; 
     
    725728        my @ocr_results = (); 
    726729        my $scansets = get_scansets(); 
     730        my $newlist = ''; 
     731        foreach my $s (@$scansets) { 
     732            $newlist .= ' ' . $s->{label} . '(' . $s->{hit_counter} . ')'; 
     733        } 
     734        infolog("Scanset Order:$newlist"); 
    727735        my $mcnt = 0; 
    728736        my $modus = 0; 
     
    846854                        } 
    847855                    } 
    848                     my $newlist; 
    849                     @$scansets = sort { $b->{hit_counter} <=> $a->{hit_counter} } @$scansets; 
    850                     foreach my $s (@$scansets) { 
    851                         $newlist .= ' ' . $s->{label} . '(' . $s->{hit_counter} . ')'; 
    852                     } 
    853                     infolog("New sorted list:$newlist"); 
    854856 
    855857                } 
  • trunk/devel/FuzzyOcr/Config.pm

    r108 r110  
    131131 
    132132sub get_scansets { 
     133    if ($conf->{focr_autosort_scanset}) { 
     134        @scansets = sort { $b->{hit_counter} <=> $a->{hit_counter} } @scansets; 
     135    } 
    133136    return \@scansets; 
    134137}