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 |
|
|
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"; |
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 |