CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Regular Expressions:
need help in running this code


Tehmina Iqbal

Mar 26, 2011, 9:37 AM

Post #1 of 1 (5111 views)
need help in running this code Can't Post

the following code shows me no error msg while running but it keeps on running without showing any output until i have to forcefull terminate it. while debugging it shows values before line # 11 but when it comes to line # 11 i have to keep on pressing f8 key for 13 or 14 times and then it stops debugging. it happens when we call build index function.

use Search::VectorSpace;

open instream, "D:/coding/d1.txt";
$/=undef; # It is used read all text at once from the file.
@docs = <instream>;
close instream ;
print @docs;

my $engine = Search::VectorSpace->new( docs => \@docs );

$engine->build_index(); # i can debug till here and then it stops...
$engine->set_threshold( 0.8 );

while ( my $query = <> ) {
my %results = $engine->search( $query );
foreach my $result ( sort { $results{$b} <=> $results{$a} }
keys %results ) {
print "Relevance: ", $results{$result}, "\n";
print $result, "\n\n";

print "Next query?\n";

i am attaching the file

plz help me to run this code
Attachments: (8.44 KB)


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives