/[pgestraier]/trunk/data/indexer.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 /trunk/data/indexer.pl

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

revision 29 by dpavlin, Wed Jul 6 11:47:56 2005 UTC revision 30 by dpavlin, Wed Jul 6 14:34:10 2005 UTC
# Line 31  sub qv { Line 31  sub qv {
31                  $all_quotes->{$v}++;                  $all_quotes->{$v}++;
32                  return '';                  return '';
33          }          }
34          $t =~ s#([_'])([^_']+?)\1 \(qv\)#qv_print($2)#ge;          $t =~ s#([_'"])([^_'"]+?)\1 \(qv\)#qv_print($2)#ge;
35  }  }
36    
37  my $i = 0;  my $i = 0;
# Line 46  while(<$t>) { Line 46  while(<$t>) {
46          if (/^#\s+(.*)\s*$/) {          if (/^#\s+(.*)\s*$/) {
47                  $title = $1;                  $title = $1;
48                  if ($title =~ m#^("*)(.*)\1\s*\((\d+)\)(:?\s*\(\w+\))*$#) {                  if ($title =~ m#^("*)(.*)\1\s*\((\d+)\)(:?\s*\(\w+\))*$#) {
49                          $year = $3;                          ($title, $year) = ($2,$3);
50                          $all_titles->{$2}++;                          $all_titles->{$title}++;
51                          $all_years->{$3}++;                          $all_years->{$3}++;
52                  } else {                  } else {
53                          $year = undef;                          $year = undef;
# Line 72  while(<$t>) { Line 72  while(<$t>) {
72    
73                  # add attributes to the document object                  # add attributes to the document object
74                  $doc->add_attr('@uri', "file://localhost/trivia/$i");                  $doc->add_attr('@uri', "file://localhost/trivia/$i");
75    
76                  $doc->add_attr('@title', $title);                  $doc->add_attr('@title', $title);
77                    $doc->add_hidden_text(
78                            ($title x $title_rank)
79                    );
80    
81                  $doc->add_attr('@size', length($trivia));                  $doc->add_attr('@size', length($trivia));
82    
83                  $doc->add_attr('year', $year) if ($year);                  $doc->add_attr('year', $year) if ($year);
# Line 83  while(<$t>) { Line 88  while(<$t>) {
88    
89                  # add the body text to the document object                  # add the body text to the document object
90                  $doc->add_text($trivia);                  $doc->add_text($trivia);
                 $doc->add_hidden_text(  
                         ($title x $title_rank)  
                 );  
91    
92    
93                  # register the document object to the database                  # register the document object to the database

Legend:
Removed from v.29  
changed lines
  Added in v.30

  ViewVC Help
Powered by ViewVC 1.1.26