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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



Tehmina Iqbal
Novice

Mar 26, 2011, 9:37 AM

Post #1 of 1 (1928 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 VextorSpace.pm file

plz help me to run this code
Attachments: VectorSpace.pm (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