15 |
|
|
16 |
use lib './lib'; |
use lib './lib'; |
17 |
use WebPAC; |
use WebPAC; |
18 |
use WebPAC::jsFind; |
#use WebPAC::jsFind; |
19 |
|
use WebPAC::HyperEstraier; |
20 |
use WebPAC::Index; |
use WebPAC::Index; |
21 |
use WebPAC::Tree; |
use WebPAC::Tree; |
22 |
|
|
24 |
# |
# |
25 |
my $code_page = 'ISO-8859-2'; |
my $code_page = 'ISO-8859-2'; |
26 |
my ($limit_mfn, $start_mfn, $debug, $low_mem); |
my ($limit_mfn, $start_mfn, $debug, $low_mem); |
27 |
my $index_path = './out/index'; |
#my $index_path = './out/index'; |
28 |
|
my $index_path = './out/casket'; |
29 |
|
|
30 |
my $result = GetOptions( |
my $result = GetOptions( |
31 |
"code_page=s" => \$code_page, |
"code_page=s" => \$code_page, |
106 |
|
|
107 |
my $log = $webpac->_get_logger() || die "can't get logger"; |
my $log = $webpac->_get_logger() || die "can't get logger"; |
108 |
|
|
109 |
$log->debug("creating WebPAC::jsFind object"); |
#$log->debug("creating WebPAC::jsFind object"); |
110 |
|
# |
111 |
|
#my $index = new WebPAC::jsFind( |
112 |
|
# index_path => $index_path, |
113 |
|
# keys => 62, |
114 |
|
#) || die; |
115 |
|
|
116 |
my $index = new WebPAC::jsFind( |
$log->debug("creating HyperEstraier object"); |
117 |
index_path => $index_path, |
my $index = new WebPAC::HyperEstraier( index_path => $index_path ) || die; |
|
keys => 62, |
|
|
) || die; |
|
118 |
|
|
119 |
my $thes; |
my $thes; |
120 |
|
|
133 |
{ 'eval' => 'length("v251") == 2 && "v800" =~ m/EUROVOC/ || "v800" =~ m/CROVOC/ && "v251" =~ m/^(H|HD|L|Z|P)$/', 'key' => 'root:v251', 'val' => 'v900' }, |
{ 'eval' => 'length("v251") == 2 && "v800" =~ m/EUROVOC/ || "v800" =~ m/CROVOC/ && "v251" =~ m/^(H|HD|L|Z|P)$/', 'key' => 'root:v251', 'val' => 'v900' }, |
134 |
{ 'eval' => '"v251"', 'key' => 'code:v900', 'val' => 'v561^4:v251' }, |
{ 'eval' => '"v251"', 'key' => 'code:v900', 'val' => 'v561^4:v251' }, |
135 |
{ 'eval' => '"v561^4" && "v562^4"', 'key' => 'code:v900', 'val' => 'v561^4:v562^4' }, |
{ 'eval' => '"v561^4" && "v562^4"', 'key' => 'code:v900', 'val' => 'v561^4:v562^4' }, |
136 |
|
{ 'key' => 'crovoc:v900', 'val' => 'filter{CROVOC}v800' }, |
137 |
], |
], |
138 |
); |
); |
139 |
|
|
184 |
|
|
185 |
# strip all non word characters from beginning or end |
# strip all non word characters from beginning or end |
186 |
# of word |
# of word |
187 |
my $words = join(" ",@{$ds->{'swish'}}); |
my $words = unac(join(" ",@{$ds->{'swish'}})); |
188 |
$words =~ s/^\W+//; |
$words =~ s/^\W+//; |
189 |
$words =~ s/\W*\s+\W*/ /g; |
$words =~ s/\W*\s+\W*/ /g; |
190 |
$words =~ s/\W+$//; |
$words =~ s/\W+$//; |
201 |
#path => $f, |
#path => $f, |
202 |
path => $webpac->mfn, |
path => $webpac->mfn, |
203 |
headline => $h, |
headline => $h, |
204 |
words => unac($words), |
words => $words, |
205 |
); |
); |
206 |
} |
} |
207 |
|
|
282 |
return(9, $l->{"a:$code:"} ) if (defined($l->{"a:$code:"})); |
return(9, $l->{"a:$code:"} ) if (defined($l->{"a:$code:"})); |
283 |
}, |
}, |
284 |
style => 'display: none', |
style => 'display: none', |
285 |
|
iframe => 1, |
286 |
},{ |
},{ |
287 |
# 1 |
# 1 |
288 |
code_arr => sub { @{$_[0]} }, |
code_arr => sub { @{$_[0]} }, |
292 |
lookup_mfn => sub { shift @{$l->{"900_mfn:".$_[0]}} }, |
lookup_mfn => sub { shift @{$l->{"900_mfn:".$_[0]}} }, |
293 |
have_children => sub { return $l->{"a:".$_[1].":"} }, |
have_children => sub { return $l->{"a:".$_[1].":"} }, |
294 |
style => 'display: none', |
style => 'display: none', |
|
iframe => 1, |
|
295 |
},{ |
},{ |
296 |
# 2 |
# 2 |
297 |
code_arr => sub { @{$_[0]} }, |
code_arr => sub { @{$_[0]} }, |
369 |
my $url = "thes/${mfn}.html"; |
my $url = "thes/${mfn}.html"; |
370 |
return $url if (-e "./out/$url"); |
return $url if (-e "./out/$url"); |
371 |
}, |
}, |
372 |
iframe_base => '../', |
nodes_dir => 'nodes', |
373 |
); |
); |
374 |
|
|
375 |
$tree->output( |
$tree->output( |
378 |
template_dir => './output_template/', |
template_dir => './output_template/', |
379 |
template_tree => 'tree.tt', |
template_tree => 'tree.tt', |
380 |
template_node => 'node.tt', |
template_node => 'node.tt', |
|
nodes => 'nodes', |
|
381 |
js => 'tree-ids.js', |
js => 'tree-ids.js', |
382 |
); |
); |
383 |
|
|
387 |
template_dir => './output_template/', |
template_dir => './output_template/', |
388 |
template_tree => 'hijerarhija.tt', |
template_tree => 'hijerarhija.tt', |
389 |
template_node => 'hijerarhija_node.tt', |
template_node => 'hijerarhija_node.tt', |
|
nodes => 'nodes', |
|
390 |
js => 'tree-ids.js', |
js => 'tree-ids.js', |
391 |
); |
); |
392 |
|
|