/[Semantic-Engine]/EPrints/index.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 /EPrints/index.pl

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

revision 4 by dpavlin, Fri Jun 29 09:52:53 2007 UTC revision 13 by dpavlin, Fri Jun 29 18:46:45 2007 UTC
# Line 3  Line 3 
3  use strict;  use strict;
4  use Semantic::API;  use Semantic::API;
5  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
6    
7  use EPrints qw/_x/;  use EPrints qw/_x/;
8    
9  use lib '/home/dpavlin/stem-hr/';  use lib '/home/dpavlin/stem-hr/';
10  use StemHR;  use StemHR;
11    
 warn dump( StemHR->stem('kuæni') );  
   
12  my $debug = shift @ARGV;  my $debug = shift @ARGV;
13    
 my $type = 'slogovi';  
   
14  my $dbh = EPrints->dbh;  my $dbh = EPrints->dbh;
15  my $sth = $dbh->prepare(qq{  my $sth = $dbh->prepare(qq{
16  SELECT  SELECT
# Line 34  $indexer->add_word_filters( minimum_leng Line 32  $indexer->add_word_filters( minimum_leng
32                              maximum_word_length => 15 );                              maximum_word_length => 15 );
33    
34  # use this encoding for any incoming text  # use this encoding for any incoming text
35  #$indexer->set_default_encoding( "utf8");  $indexer->set_default_encoding( "iso-8859-2" );
36    
37  my $total = 0;  my $total = 0;
38    
# Line 46  while (my $row = $sth->fetchrow_hashref Line 44  while (my $row = $sth->fetchrow_hashref
44                  EPrints->lookup( 'abstract' )                  EPrints->lookup( 'abstract' )
45          );          );
46          my @body = split( /\W*\s+\W*/, "$title $title $title $keywords $keywords $abstract" );          my @body = split( /\W*\s+\W*/, "$title $title $title $keywords $keywords $abstract" );
47          my $body;          my $body = '';
48          foreach my $word ( @body ) {          foreach my $word ( @body ) {
49  #               $body .= StemHR->stem( $word ) . ' ';                  $body .= StemHR->stem( $word ) . ' ';
                 $body .= join(" ",EPrints::slogovi( $word )) . ' ';  
50          }          }
51    
52            $body .= EPrints::slogovi( "$title $keywords $abstract" );
53    
54          warn "body: $body\n" if $debug;          warn "body: $body\n" if $debug;
55    
56      $indexer->index( $row->{id}, join(" ", @body, $body ) );          $body .= EPrints->fulltext_content;
57    
58            $indexer->index( $row->{id}, join(" ", @body, $body ) );
59          $total++;          $total++;
60          print STDERR _x( $row->{id}, " ", $row->{title} ), "\n";          print STDERR _x( $row->{id}, " ", $row->{title} ), "\n";
61  }  }

Legend:
Removed from v.4  
changed lines
  Added in v.13

  ViewVC Help
Powered by ViewVC 1.1.26