Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Vector space search

by Anonymous Monk
on Dec 05, 2012 at 03:49 UTC ( #1007187=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear Perl Monks, I am tring to use the module Search:VectorSpace to search for documents containing my query terms. But I'm not able to implement it. http://www.perl.com/pub/2003/02/19/engine.html

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; }
As mentioned in the module description above, I just need to place my document list in the @docs array. But on doing so, the search is happening only on the document names, but not the content. This is how I did it, is it right?
$dr="C:\\Users\\Desktop\\collection2"; opendir(DR, "$dr") || die "$!" ; @docs=<DR>; @docs=readdir DR;
I want it to search inside the document, not the document names.

Comment on Vector space search
Select or Download Code
Re: Vector space search
by Anonymous Monk on Dec 05, 2012 at 04:10 UTC

    I want it to search inside the document, not the document names.

    Then you should put the "inside the documents" inside the array instead of the "document names"

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1007187]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2014-12-29 06:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (184 votes), past polls