/[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 8 by dpavlin, Fri Jun 29 14:53:14 2007 UTC revision 9 by dpavlin, Fri Jun 29 15:29:55 2007 UTC
# Line 18  use Cwd qw/abs_path/; Line 18  use Cwd qw/abs_path/;
18  use lib '/home/dpavlin/stem-hr/';  use lib '/home/dpavlin/stem-hr/';
19  use StemHR;  use StemHR;
20    
21    my $debug = 1;
22    
23  my $abs_path = abs_path( $0 );  my $abs_path = abs_path( $0 );
24  $abs_path =~ s!/[^/]*$!/!;  #!fix-vim  $abs_path =~ s!/[^/]*$!/!;  #!fix-vim
25    
# Line 83  if( $query || $similar ) { Line 85  if( $query || $similar ) {
85          ($results, $terms) = $semantic->find_similar( $similar );          ($results, $terms) = $semantic->find_similar( $similar );
86          }          }
87    
88  warn "results = ",dump( $results );  warn "results = ",dump( $results ) if $debug;
89  warn "terms = ",dump( $terms );  warn "terms = ",dump( $terms ) if $debug;
90                    
91          ##################################          ##################################
92          #       TERM BASED CALCULATIONS          #       TERM BASED CALCULATIONS
93          ##################################          ##################################
94          my @sorted_terms = sort { $terms->{$b} <=> $terms->{$a} } keys %$terms;          my @sorted_terms = sort { $terms->{$b} <=> $terms->{$a} } keys %$terms;
95          my @top_terms = splice( @sorted_terms, $start, $TERMS_TO_DISPLAY );          my @top_terms = splice( @sorted_terms, $start, $TERMS_TO_DISPLAY );
96            
97    warn "top_terms = ", dump( @top_terms ) if $debug;
98    
99          print "<p>Full query: $full_query</p>\n";          print "<p>Full query: $full_query</p>\n";
100          print "<p>Related Terms: ". ( join ", ", @top_terms ) ."</p>\n";          print "<p>Related Terms: ". ( join ", ", @top_terms ) ."</p>\n";
101          print "<hr />\n";          print "<hr />\n";
# Line 106  warn "terms = ",dump( $terms ); Line 110  warn "terms = ",dump( $terms );
110      my @sorted_results = sort { $results->{$b} <=> $results->{$a} } keys %$results;      my @sorted_results = sort { $results->{$b} <=> $results->{$a} } keys %$results;
111          my @display_results = splice( @sorted_results, $start, $RESULTS_TO_DISPLAY );          my @display_results = splice( @sorted_results, $start, $RESULTS_TO_DISPLAY );
112                    
113  warn dump( @display_results );    warn "display results = ", dump( @display_results ) if $debug;
114                    
115          ##################################          ##################################
116          #       Access the storage engine to          #       Access the storage engine to

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

  ViewVC Help
Powered by ViewVC 1.1.26