Search::Tools::Keywords 0.06 review

Download
by rbytes.net on

Search::Tools::Keywords is a Perl module to extract keywords from a search query. SYNOPSIS use Search::Tools::Keywords; use

License: Perl Artistic License
File size: 0K
Developer: Peter Karman
0 stars award from rbytes.net

Search::Tools::Keywords is a Perl module to extract keywords from a search query.

SYNOPSIS

use Search::Tools::Keywords;
use Search::Tools::RegExp;

my $query = 'the quick fox color:brown and "lazy dog" not jumped';

my $kw = Search::Tools::Keywords->new(
stopwords => 'the',
and_word => 'and',
or_word => 'or',
not_word => 'not',
stemmer => &your_stemmer_here,
ignore_first_char => '+-',
ignore_last_char => '',
word_characters => $Search::Tools::RegExp::WordChar,
debug => 0,
phrase_delim => '"',
charset => 'iso-8859-1',
lang => 'en_US',
locale => 'en_US.iso-8859-1'
);

my @words = $kw->extract( $query );
# returns:
# quick
# fox
# brown
# lazy dog

Do not confuse this class with Search::Tools::RegExp::Keywords.

Search::Tools::Keywords extracts the meaningful words from a search query. Since many search engines support a syntax that includes special characters, boolean words, stopwords, and fields, search queries can become complicated. In order to separate the wheat from the chafe, the supporting words and symbols are removed and just the actual search terms (keywords) are returned.

This class is used internally by Search::Tools::RegExp. You probably don't need to use it directly. But if you do, read on.

Requirements:
Perl

Search::Tools::Keywords 0.06 keywords