Dear PerlMonks,
I'm using the module Search::VectorSpace to query a list of documents and return the relevant documents.
the description given in the module is as follows:-
use Search::VectorSpace;
my @docs = ...;
my $engine = Search::VectorSpace->new( docs =>\@docs, threshol
+d => .04);
$engine->build_index();
while ( my $query = <> ) {
my %results = $engine->search( $query );
print join "\n", keys %results;
I have given a list of documents:-
$dr="C:\\Users\\Desktop\\collection2";
opendir(DR, "$dr") || die "error" ;
@docs=<DR>;
@docs=readdir DR;
But the search is done only on the file names, but not the contents of the file. How do I search for something within the files of the given directory?