If I only had tens of searches, I'd go with something quick and easy like
Search::VectorSpace. The module's author wrote an article for perl.com about
building a vector-space search engine. Here's the search engine given by the author:
#!/usr/bin/perl
use strict;
use warnings;
use Search::VectorSpace;
my @docs = get_documents_from_somewhere();
my $engine = Search::VectorSpace->new(docs =>\@docs);
$engine->build_index();
$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";
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.