/[Semantic-Engine]/EPrints/search.cgi
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/search.cgi

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

revision 5 by dpavlin, Fri Jun 29 10:01:31 2007 UTC revision 8 by dpavlin, Fri Jun 29 14:53:14 2007 UTC
# Line 15  use CGI; Line 15  use CGI;
15  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
16  use EPrints;  use EPrints;
17  use Cwd qw/abs_path/;  use Cwd qw/abs_path/;
18    use lib '/home/dpavlin/stem-hr/';
19    use StemHR;
20    
21  my $abs_path = abs_path( $0 );  my $abs_path = abs_path( $0 );
22  $abs_path =~ s!/[^/]*$!/!;  #!fix-vim  $abs_path =~ s!/[^/]*$!/!;  #!fix-vim
# Line 34  my $start = $cgi->param( 'start' ) || 0; Line 36  my $start = $cgi->param( 'start' ) || 0;
36  my $query = $cgi->param( 'query' ) || '';  my $query = $cgi->param( 'query' ) || '';
37  my $similar = $cgi->param( 'similar' ) || '';  my $similar = $cgi->param( 'similar' ) || '';
38  my $slogovi = $cgi->param( 'slogovi' );  my $slogovi = $cgi->param( 'slogovi' );
39    my $stem = $cgi->param( 'stem' );
40    
41  my $charset='iso-8859-2';  my $charset='iso-8859-2';
42    
43  my $full_query = $query;  my $full_query = $query;
44  $full_query .= " " . join(" ", EPrints::slogovi( $query )) if ($slogovi);  $full_query .= " " . EPrints::slogovi( $query ) if ($slogovi);
45    $full_query .= " " . StemHR->stem( $query ) if ($stem);
46    
47  ##############################  ##############################
48  #       Start the HTML output  #       Start the HTML output
# Line 57  print qq|<?xml version="1.0" encoding="$ Line 61  print qq|<?xml version="1.0" encoding="$
61      <p>      <p>
62        <input type="text" name="query" value="$query" />        <input type="text" name="query" value="$query" />
63        <input type="submit" />        <input type="submit" />
64            |, $cgi->checkbox( -name => 'slogovi' ), qq|            |, $cgi->checkbox( -name => 'stem' ), $cgi->checkbox( -name => 'slogovi' ), qq|
65      </p>\n|;      </p>\n|;
66    
67    
# Line 112  warn dump( @display_results ); Line 116  warn dump( @display_results );
116          print $semantic->paginate( "?query=$query;similar=$similar", $start, scalar keys %$results, $RESULTS_TO_DISPLAY);          print $semantic->paginate( "?query=$query;similar=$similar", $start, scalar keys %$results, $RESULTS_TO_DISPLAY);
117          foreach my $id ( @display_results ){          foreach my $id ( @display_results ){
118                  EPrints->id( $id );                  EPrints->id( $id );
119          print "<p>$i. <b>", EPrints->lookup( 'title' ), "</b> <em>", sprintf("%.2f",$results->{$id}), "</em> <a href=\"?similar=$id\">similar</a></p>\n";          print "<p>$i. <b>", EPrints->lookup( 'title' ), "</b>";
120                    print "$id <em>", sprintf("%.2f",$results->{$id}), "</em> <a href=\"?similar=$id\">similar</a></p>\n";
121          print "<p>";          print "<p>";
122  #               print $semantic->summarize($id);  #               print $semantic->summarize($id);
123                    print "</p><p>Keywords: ", EPrints->lookup('keywords'), "</p><p>";
124                  print "<small>", EPrints->lookup('abstract'), "</small>";                  print "<small>", EPrints->lookup('abstract'), "</small>";
125                  print "</p>\n";                  print "</p>\n";
126          $i++;          $i++;

Legend:
Removed from v.5  
changed lines
  Added in v.8

  ViewVC Help
Powered by ViewVC 1.1.26