/[mws]/trunk/MWS.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/MWS.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 22 by dpavlin, Sat May 8 01:13:33 2004 UTC revision 26 by dpavlin, Sat May 8 16:24:46 2004 UTC
# Line 66  sub normalize_string { Line 66  sub normalize_string {
66          $v = join('',sort split(/\s+/,$v));          $v = join('',sort split(/\s+/,$v));
67          $v =~ s/\W+//g;          $v =~ s/\W+//g;
68    
69          return $v;          return lc($v);
70  }  }
71    
72  # reset tables for search results  # reset tables for search results
# Line 222  sub search { Line 222  sub search {
222    
223          $self->{'curr_result'} = 0;          $self->{'curr_result'} = 0;
224    
225            $self->reset_counters;
226    
227          print STDERR "$results results\n" if ($debug == 2);          print STDERR "$results results\n" if ($debug == 2);
228    
229          return $results || 'error';          return $results || 'error';
# Line 328  sub plain_text_body { Line 330  sub plain_text_body {
330                  }                  }
331          }          }
332    
333            if (! $body) {
334                    $body = "[plain/text body not found]" if ($debug == 2);
335                    print STDERR "plain/text body not found\n" if ($debug);
336                    return;
337            }
338    
339          # reformat with Text::Autoformat          # reformat with Text::Autoformat
340          my $wrap = $self->{wrap_margin};          my $wrap = $self->{wrap_margin};
341          if ($wrap && $body && $body =~ m/^.{$wrap}..*$/m) {          if ($wrap && $body && $body =~ m/^.{$wrap}..*$/m) {
                 $body =~ s/[\r\n]/\n/gs;  
342                  $body = autoformat($body, {right=>$wrap, all=>1});                  $body = autoformat($body, {right=>$wrap, all=>1});
343                  $body .="\n[reformated using autoformat, margin at $wrap]" if ($debug == 2);                  $body .="\n[reformated using autoformat, margin at $wrap]" if ($debug == 2);
344          }          }
# Line 375  sub fetch_result_by_id { Line 382  sub fetch_result_by_id {
382                  print STDERR "$id stored in cache\n" if ($debug == 2);                  print STDERR "$id stored in cache\n" if ($debug == 2);
383          } else {          } else {
384                  print STDERR "fetch_result_by_id($id) in cache\n" if ($debug == 2);                  print STDERR "fetch_result_by_id($id) in cache\n" if ($debug == 2);
385                    foreach my $p (qw(from to cc bcc)) {
386                            foreach my $v (@{$row->{$p}}) {
387                                    $self->add_counter($p,$v);
388                            }
389                    }
390    
391                    $self->add_counter_calendar($row->{date_utime});
392          }          }
393    
394          return $row;          return $row;

Legend:
Removed from v.22  
changed lines
  Added in v.26

  ViewVC Help
Powered by ViewVC 1.1.26