/[mws]/trunk/mbox2index.pl
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/mbox2index.pl

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

revision 17 by dpavlin, Fri May 7 11:25:01 2004 UTC revision 43 by dpavlin, Tue May 11 15:36:51 2004 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2    
3  use MWS;  BEGIN {
4            my $basedir = readlink($0) || $0; $basedir =~ s#/[^/]+$##;
5            unshift(@INC, $basedir);
6    }
7    
8    use MWS::SWISH;
9    #use MWS::Plucene;
10  use Data::Dumper;  use Data::Dumper;
11  use Date::Parse;  use Date::Parse;
12  use POSIX qw(strftime);  use POSIX qw(strftime);
13    use Getopt::Long;
14    
15    # are we called from this script?
16    my $recursive = 0;
17    
18    my $r = GetOptions("recursive" => \$recursive);
19    
20    my $config_file = shift @ARGV || 'global.conf';
21    
22    if (! -f $config_file) {
23            print qq{Usage: $0 [/path/to/local.conf]
24    
25    If local.conf is not specified, global.conf in current directory will
26    be used.
27    };
28            exit 1;
29    }
30    
31    my $mws = MWS::SWISH->new(config_file => $config_file);
32    #my $mws = MWS::Plucene->new(config_file => $config_file);
33    
34    $mws->create_index if (! $recursive);
35    
36  my $mws = MWS->new('global.conf');  print STDERR "starting indexing...\n";
37    
38  my $debug = 1;  my $debug = 1;
39    
# Line 29  foreach my $mbox ($mws->{config}->Parame Line 57  foreach my $mbox ($mws->{config}->Parame
57    
58                  foreach my $direction (qw(to from cc bcc)) {                  foreach my $direction (qw(to from cc bcc)) {
59                          foreach my $part (qw(phrase address comment)) {                          foreach my $part (qw(phrase address comment)) {
60                                  $document->{$direction.'_'.$part} = join("##", $mws->unroll($message,$direction,$part));                                  my @data = $mws->unroll($message,$direction,$part);
61                                    $document->{$direction.'_'.$part} = join("##", @data) if (@data);
62                          }                          }
63                  }                  }
64    

Legend:
Removed from v.17  
changed lines
  Added in v.43

  ViewVC Help
Powered by ViewVC 1.1.26