Changeset 72

Show
Ignore:
Timestamp:
30.11.2006 21:22:07 (2 years ago)
Author:
jorge
Message:

Fixed personal_wordlist processing, broke since ~ver 68

Files:

Legend:

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

    r70 r72  
    122122 
    123123    debuglog("Starting FuzzyOcr..."); 
    124     if ($conf->{focr_personal_wordlist} =~ m/^\//) { 
    125         debuglog("Attempting to load personal wordlist..."); 
    126         read_words( $conf->{focr_personal_wordlist} ); 
    127     } 
    128  
    129124    foreach my $p ( 
    130125        $pms->{msg}->find_parts(qr(^image\b)i), 
     
    281276    debuglog("Errors to: $imgdir/raw.err") if ($haserr>0); 
    282277 
     278    # Try to load personal wordlist 
     279    if ($conf->{focr_personal_wordlist} =~ m/^\//) { 
     280        infolog("Attempting to load personal wordlist..."); 
     281        read_words( $conf->{focr_personal_wordlist} ); 
     282    } else { 
     283        my $peruserlist = $main->sed_path($conf->{focr_personal_wordlist}); 
     284        if ( -r $peruserlist ) { 
     285            read_words( $peruserlist ); 
     286        } else { 
     287            errorlog("Cannot read personal_wordlist: $peruserlist, skipping..."); 
     288        } 
     289    } 
     290 
    283291    IMAGE: 
    284292    foreach my $file (keys %imgfiles) { 
  • trunk/devel/FuzzyOcr/Config.pm

    r71 r72  
    506506    my $main = $self->{main}; 
    507507    $conf = $opts->{conf}; 
    508  
    509  
    510     # fix paths 
    511     foreach (qw/focr_personal_wordlist focr_global_wordlist 
    512             focr_db_hash focr_db_safe focr_hash_db 
    513             focr_scanset_file focr_preprocessor_file/) { 
    514         next unless defined $conf->{$_}; 
    515         my $path = $main->sed_path($conf->{$_}); 
    516         $conf->{$_} = $path ? $path : $_; 
    517         debuglog("$_ => $path"); 
    518     } 
    519508 
    520509    # find external binaries