/[wait]/trunk/script/index_ora
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/script/index_ora

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

revision 70 by laperla, Fri Jan 25 07:27:30 2002 UTC revision 71 by laperla, Sun Jan 27 15:27:38 2002 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2  #                              -*- Mode: Perl -*-  #                              -*- Mode: Perl -*-
3  # $Basename$  # $Basename$
4  # $Revision: 1.7 $  # $Revision: 1.8 $
5  # Author          : Ulrich Pfeifer  # Author          : Ulrich Pfeifer
6  # Created On      : Mon Dec 31 13:57:11 2001  # Created On      : Mon Dec 31 13:57:11 2001
7  # Last Modified By: Ulrich Pfeifer  # Last Modified By: Ulrich Pfeifer
# Line 14  Line 14 
14  use 5.007;  use 5.007;
15    
16  use strict;  use strict;
17    use Devel::Peek qw(Dump);
18    
19  use File::Path;  use File::Path;
20  use DB_File;  use DB_File;
# Line 60  my $text  = [{ Line 61  my $text  = [{
61                'intervall' => ['OR_tr_20020124', 'OR_lc_20020124'],                'intervall' => ['OR_tr_20020124', 'OR_lc_20020124'],
62               },               },
63               'OR_tr_20020124', 'OR_lc_20020124', 'split2', 'stop'];               'OR_tr_20020124', 'OR_lc_20020124', 'split2', 'stop'];
64  my $sound = ['OR_tr_20020124', 'OR_lc_20020124', 'split2', 'Soundex'],;  my $sound = ['OR_tr_20020124', 'OR_lc_20020124', 'split2', 'Soundex'];
65    my $trigr = ['OR_lc_20020124', 'OR_trigrams_20020125'];
66    
67  my $cwd = cwd;  my $cwd = cwd;
68    
# Line 98  while (($did, $value) = each %D) { Line 100  while (($did, $value) = each %D) {
100                %{$record});                %{$record});
101  }  }
102  $tb->set(top=>1);  $tb->set(top=>1);
103    
104    my $tritb = $db->create_table(
105                                  name => "$OPT{table}_fallback",
106                                  attr => [qw(docid headline)],
107                                  invindex => [ headline => $trigr ],
108                                 );
109    my %dict;
110    for my $f ($tb->fields) {
111      my(@idx) = @{$tb->table->{inverted}{$f} || []};
112      for my $idx (@idx) {
113        my @keys = $idx->keys;
114        @dict{@keys} = ();
115      }
116    }
117    my @dictkeys = grep s/^p//, keys %dict;
118    my $maxdebug = 5;
119    for my $headline (@dictkeys) {
120      if ($maxdebug && $headline =~ /[^\040-\177]/) {
121        Dump $headline;
122        $maxdebug--;
123      }
124      $tritb->insert(docid => $headline, headline => $headline);
125    }
126    $tritb->set(top=>1);
127    $tritb->close;
128  $tb->close();  $tb->close();
129  $db->close();  $db->close();
130    

Legend:
Removed from v.70  
changed lines
  Added in v.71

  ViewVC Help
Powered by ViewVC 1.1.26