1 |
#!/usr/bin/perl -w |
#!/usr/bin/perl -w |
2 |
# -*- Mode: Perl -*- |
# -*- Mode: Perl -*- |
3 |
# $Basename$ |
# $Basename$ |
4 |
# $Revision: 1.8 $ |
# $Revision: 1.9 $ |
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 |
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']; |
my $trigr = ['OR_lc_20020124', 'OR_trigrams_20020125']; |
66 |
|
my $isbn = ['split6', 'OR_isbn_20020127']; |
67 |
|
|
68 |
my $cwd = cwd; |
my $cwd = cwd; |
69 |
|
|
78 |
access => $access, |
access => $access, |
79 |
invindex => |
invindex => |
80 |
[ |
[ |
81 |
'title' => $stem, |
'title' => $text, |
82 |
'about' => $stem, |
# 'title' => $stem, |
83 |
'text' => $text, |
'aboutauthor' => $text, |
84 |
|
# 'aboutauthor' => $stem, |
85 |
|
'desc' => $text, |
86 |
|
'abstract' => $text, |
87 |
'author' => $text, |
'author' => $text, |
88 |
|
# 'author' => $sound, |
89 |
'colophon' => $text, |
'colophon' => $text, |
90 |
'author' => $sound, |
'isbn' => $isbn, |
|
'isbn' => $text, |
|
91 |
] |
] |
92 |
); |
); |
93 |
die "Couldn't create table $OPT{table}: $@\n" unless $tb; |
die "Couldn't create table $OPT{table}: $@\n" unless $tb; |
107 |
|
|
108 |
my $tritb = $db->create_table( |
my $tritb = $db->create_table( |
109 |
name => "$OPT{table}_fallback", |
name => "$OPT{table}_fallback", |
110 |
attr => [qw(docid headline)], |
attr => [qw(docid headline)], # name |
111 |
|
# "headline" |
112 |
|
# only for |
113 |
|
# sman |
114 |
invindex => [ headline => $trigr ], |
invindex => [ headline => $trigr ], |
115 |
); |
); |
116 |
my %dict; |
my %dict; |
117 |
for my $f ($tb->fields) { |
for my $f ($tb->fields) { |
118 |
my(@idx) = @{$tb->table->{inverted}{$f} || []}; |
my(@idx) = @{$tb->table->{inverted}{$f} || []}; |
119 |
for my $idx (@idx) { |
for my $idx (@idx) { |
120 |
|
my $name = $idx->name; |
121 |
|
next if $name =~ /(_|\b)(Stem|Soundex)(\b|_)/; # irrelevant for alternatives |
122 |
my @keys = $idx->keys; |
my @keys = $idx->keys; |
123 |
@dict{@keys} = (); |
@dict{@keys} = (); |
124 |
} |
} |
130 |
Dump $headline; |
Dump $headline; |
131 |
$maxdebug--; |
$maxdebug--; |
132 |
} |
} |
133 |
|
# printf "%s\n", substr($headline,0,60); |
134 |
$tritb->insert(docid => $headline, headline => $headline); |
$tritb->insert(docid => $headline, headline => $headline); |
135 |
} |
} |
136 |
$tritb->set(top=>1); |
$tritb->set(top=>1); |
149 |
symlink $long_dir, $prel_slink or die "Could not symlink $long_dir, $prel_slink: $!"; |
symlink $long_dir, $prel_slink or die "Could not symlink $long_dir, $prel_slink: $!"; |
150 |
rename $prel_slink, $want_dir or die "Could not rename $prel_slink, $want_dir: $!"; |
rename $prel_slink, $want_dir or die "Could not rename $prel_slink, $want_dir: $!"; |
151 |
|
|
152 |
|
system("chmod 777 $want_dir/*/read")==0 or die; |
153 |
|
|
154 |
$WAIT::Config = $WAIT::Config; # make perl -w happy |
$WAIT::Config = $WAIT::Config; # make perl -w happy |
155 |
|
|
156 |
|
|