Plucene::Analysis::Standard::StandardAnalyzer - standard analyzer


Plucene documentation Contained in the Plucene distribution.

Index


Code Index:

NAME

Top

Plucene::Analysis::Standard::StandardAnalyzer - standard analyzer

SYNOPSIS

Top

	my Plucene::Analysis::Stopfilter $sf = 
		Plucene::Analysis::Standard::StandardAnalyzer->tokenstream(@args);

DESCRIPTION

Top

The standard analyzer, built with a list of stop words.

This list of stop words are:

	"a",     "and",  "are",   "as",    "at",   "be",   "but",  "by",
	"for",   "if",   "in",    "into",  "is",   "it",   "no",   "not",
	"of",    "on",   "or",    "s",     "such", "t",    "that", "the",
	"their", "then", "there", "these", "they", "this", "to",   "was",
	"will",  "with"

METHODS

Top

tokenstream

	my Plucene::Analysis::Stopfilter $sf = 
		Plucene::Analysis::Standard::StandardAnalyzer->tokenstream(@args);


Plucene documentation Contained in the Plucene distribution.
package Plucene::Analysis::Standard::StandardAnalyzer;

use strict;
use warnings;

use base 'Plucene::Analysis::Analyzer';

use Plucene::Analysis::Standard::StandardTokenizer;
use Plucene::Analysis::StopFilter;

my @stopwords = (
	"a",     "and",  "are",   "as",    "at",   "be",   "but",  "by",
	"for",   "if",   "in",    "into",  "is",   "it",   "no",   "not",
	"of",    "on",   "or",    "s",     "such", "t",    "that", "the",
	"their", "then", "there", "these", "they", "this", "to",   "was",
	"will",  "with"
);

sub tokenstream {
	my $class = shift;
	return Plucene::Analysis::StopFilter->new({
			input    => Plucene::Analysis::Standard::StandardTokenizer->new(@_),
			stoplist => \@stopwords
		});
}

1;