/[webpac]/trunk2/all2all.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 /trunk2/all2all.pl

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

revision 566 by dpavlin, Sun Oct 31 18:43:33 2004 UTC revision 708 by dpavlin, Wed Jul 13 23:38:04 2005 UTC
# Line 15  use Text::Unaccent 1.02; Line 15  use Text::Unaccent 1.02;
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    
# Line 23  use WebPAC::Tree; Line 24  use WebPAC::Tree;
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,
# Line 104  my $webpac = new WebPAC( Line 106  my $webpac = new WebPAC(
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    
# Line 128  my $maxmfn = $webpac->open_isis( Line 133  my $maxmfn = $webpac->open_isis(
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    
# Line 178  while (my $rec = $webpac->fetch_rec) { Line 184  while (my $rec = $webpac->fetch_rec) {
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+$//;
# Line 195  while (my $rec = $webpac->fetch_rec) { Line 201  while (my $rec = $webpac->fetch_rec) {
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    
# Line 276  my @tree = ({ Line 282  my @tree = ({
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]} },
# Line 293  my @tree = ({ Line 300  my @tree = ({
300          lookup_term     => sub { shift @{$l->{"d:".$_[0]}} },          lookup_term     => sub { shift @{$l->{"d:".$_[0]}} },
301          lookup_mfn      => sub { shift @{$l->{"900_mfn:".$_[0]}} },          lookup_mfn      => sub { shift @{$l->{"900_mfn:".$_[0]}} },
302          have_children   => sub { return $l->{"a:".$_[1].":".$_[0]} },          have_children   => sub { return $l->{"a:".$_[1].":".$_[0]} },
303          #style          => 'display: none',          style           => 'display: none',
304          },{          },{
305          # 3 uži pojam          # 3 uži pojam
306          code_arr        => sub { @{$_[0]} },          code_arr        => sub { @{$_[0]} },
# Line 357  my @tree = ({ Line 364  my @tree = ({
364    
365  my $tree = new WebPAC::Tree(  my $tree = new WebPAC::Tree(
366          tree => \@tree,          tree => \@tree,
367            detail_url => sub {
368                    my $mfn = shift;
369                    my $url = "thes/${mfn}.html";
370                    return $url if (-e "./out/$url");
371            },
372            nodes_dir => 'nodes',
373  );  );
374    
375  $tree->output(  $tree->output(
376          dir => './out',          dir => './out',
377          html => 'browse.html',          html => 'browse.html',
378          template => './output_template/tree.tt',          template_dir => './output_template/',
379            template_tree => 'tree.tt',
380            template_node => 'node.tt',
381          js => 'tree-ids.js',          js => 'tree-ids.js',
382  );  );
383    
384  $tree->output(  $tree->output(
385          dir => './eurovoc',          dir => './eurovoc',
386          html => 'hijerarhija.html',          html => 'hijerarhija.html',
387          template => './output_template/hijerarhija.tt',          template_dir => './output_template/',
388            template_tree => 'hijerarhija.tt',
389            template_node => 'hijerarhija_node.tt',
390          js => 'tree-ids.js',          js => 'tree-ids.js',
391  );  );
392    

Legend:
Removed from v.566  
changed lines
  Added in v.708

  ViewVC Help
Powered by ViewVC 1.1.26