/[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 562 by dpavlin, Sat Oct 30 23:56:57 2004 UTC revision 591 by dpavlin, Sat Nov 6 22:46:30 2004 UTC
# Line 36  my $result = GetOptions( Line 36  my $result = GetOptions(
36  my $filter = {  my $filter = {
37          'CROVOC' => sub {          'CROVOC' => sub {
38                  my $tmp = shift || return;                  my $tmp = shift || return;
39                    $tmp =~ s/\s*HIDRA.*//;
40                  return undef unless ($tmp =~ s/\s*CROVOC.*$/ #C#/);                  return undef unless ($tmp =~ s/\s*CROVOC.*$/ #C#/);
41                  # remove repeating stars                  # remove repeating stars
42                  # FIXME this should be fixed at right place, not here!                  # FIXME this should be fixed at right place, not here!
# Line 46  my $filter = { Line 47  my $filter = {
47                  my $tmp = shift || return;                  my $tmp = shift || return;
48                  $tmp =~ s/\s*CROVOC.*$/ <img src="img\/crovoc.png" border="0">/;                  $tmp =~ s/\s*CROVOC.*$/ <img src="img\/crovoc.png" border="0">/;
49                  $tmp =~ s/\s*EUROVOC.*//;                  $tmp =~ s/\s*EUROVOC.*//;
50                    $tmp =~ s/\s*HIDRA.*//;
51                  return $tmp;                  return $tmp;
52          },          },
53          # TT filter          # TT filter
# Line 126  my $maxmfn = $webpac->open_isis( Line 128  my $maxmfn = $webpac->open_isis(
128          { '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' },
129          { 'eval' => '"v251"', 'key' => 'code:v900', 'val' => 'v561^4:v251' },          { 'eval' => '"v251"', 'key' => 'code:v900', 'val' => 'v561^4:v251' },
130          { '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' },
131            { 'key' => 'crovoc:v900', 'val' => 'filter{CROVOC}v800' },
132          ],          ],
133  );  );
134    
# Line 176  while (my $rec = $webpac->fetch_rec) { Line 179  while (my $rec = $webpac->fetch_rec) {
179    
180                  # strip all non word characters from beginning or end                  # strip all non word characters from beginning or end
181                  # of word                  # of word
182                  my $words = join(" ",@{$ds->{'swish'}});                  my $words = unac(join(" ",@{$ds->{'swish'}}));
183                  $words =~ s/^\W+//;                  $words =~ s/^\W+//;
184                  $words =~ s/\W*\s+\W*/ /g;                  $words =~ s/\W*\s+\W*/ /g;
185                  $words =~ s/\W+$//;                  $words =~ s/\W+$//;
# Line 193  while (my $rec = $webpac->fetch_rec) { Line 196  while (my $rec = $webpac->fetch_rec) {
196                          #path => $f,                          #path => $f,
197                          path => $webpac->mfn,                          path => $webpac->mfn,
198                          headline => $h,                          headline => $h,
199                          words => unac($words),                          words => $words,
200                  );                  );
201          }          }
202    
# Line 274  my @tree = ({ Line 277  my @tree = ({
277                                  return(9, $l->{"a:$code:"} ) if (defined($l->{"a:$code:"}));                                  return(9, $l->{"a:$code:"} ) if (defined($l->{"a:$code:"}));
278                          },                          },
279          style           => 'display: none',          style           => 'display: none',
280            iframe          => 1,
281          },{          },{
282          # 1          # 1
283          code_arr        => sub { @{$_[0]} },          code_arr        => sub { @{$_[0]} },
# Line 291  my @tree = ({ Line 295  my @tree = ({
295          lookup_term     => sub { shift @{$l->{"d:".$_[0]}} },          lookup_term     => sub { shift @{$l->{"d:".$_[0]}} },
296          lookup_mfn      => sub { shift @{$l->{"900_mfn:".$_[0]}} },          lookup_mfn      => sub { shift @{$l->{"900_mfn:".$_[0]}} },
297          have_children   => sub { return $l->{"a:".$_[1].":".$_[0]} },          have_children   => sub { return $l->{"a:".$_[1].":".$_[0]} },
298          #style          => 'display: none',          style           => 'display: none',
299          },{          },{
300          # 3 uži pojam          # 3 uži pojam
301          code_arr        => sub { @{$_[0]} },          code_arr        => sub { @{$_[0]} },
# Line 355  my @tree = ({ Line 359  my @tree = ({
359    
360  my $tree = new WebPAC::Tree(  my $tree = new WebPAC::Tree(
361          tree => \@tree,          tree => \@tree,
362            detail_url => sub {
363                    my $mfn = shift;
364                    my $url = "thes/${mfn}.html";
365                    return $url if (-e "./out/$url");
366            },
367            nodes_dir => 'nodes',
368  );  );
369    
370  $tree->output(  $tree->output(
371          dir => './out',          dir => './out',
372          html => 'browse.html',          html => 'browse.html',
373          template => './output_template/tree.tt',          template_dir => './output_template/',
374            template_tree => 'tree.tt',
375            template_node => 'node.tt',
376          js => 'tree-ids.js',          js => 'tree-ids.js',
377  );  );
378    
379  $tree->output(  $tree->output(
380          dir => './eurovoc',          dir => './eurovoc',
381          html => 'hijerarhija.html',          html => 'hijerarhija.html',
382          template => './output_template/hijerarhija.tt',          template_dir => './output_template/',
383            template_tree => 'hijerarhija.tt',
384            template_node => 'hijerarhija_node.tt',
385          js => 'tree-ids.js',          js => 'tree-ids.js',
386  );  );
387    

Legend:
Removed from v.562  
changed lines
  Added in v.591

  ViewVC Help
Powered by ViewVC 1.1.26