| 1 | package Plucene::Analysis::StopAnalyzer; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | Plucene::Analysis::StopAnalyzer - the stop-word analyzer | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | my Plucene::Analysis::StopFilter $sf | ||
| 10 | = Plucene::Analysis::StopAnalyzer->new(@args); | ||
| 11 | |||
| 12 | =head1 DESCRIPTION | ||
| 13 | |||
| 14 | Filters LetterTokenizer with LowerCaseFilter and StopFilter. | ||
| 15 | |||
| 16 | =head1 METHODS | ||
| 17 | |||
| 18 | =cut | ||
| 19 | |||
| 20 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | |||
| 23 | 1 | ▶ | use Plucene::Analysis::LowerCaseTokenizer; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 24 | 1 | ▶ | use Plucene::Analysis::StopFilter; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 25 | 1 | ▶ | use base 'Plucene::Analysis::Analyzer'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 26 | |||
| 27 | 1 | my @stopwords = ( | |
| 28 | "a", "and", "are", "as", "at", "be", "but", "by", | ||
| 29 | "for", "if", "in", "into", "is", "it", "no", "not", | ||
| 30 | "of", "on", "or", "s", "such", "t", "that", "the", | ||
| 31 | "their", "then", "there", "these", "they", "this", "to", "was", | ||
| 32 | "will", "with" | ||
| 33 | ); | ||
| 34 | |||
| 35 | =head2 tokenstream | ||
| 36 | |||
| 37 | my Plucene::Analysis::StopFilter $sf | ||
| 38 | = Plucene::Analysis::StopAnalyzer->new(@args); | ||
| 39 | |||
| 40 | Filters LowerCaseTokenizer with StopFilter. | ||
| 41 | |||
| 42 | =cut | ||
| 43 | |||
| 44 | 2 | ▶ | sub tokenstream { |
|
Subroutine
tokenstream: called CC=1 SCAR=0.0
Pod
documented
| |||
| 45 | 2 | my $self = shift; | |
| 46 | 2 | return Plucene::Analysis::StopFilter->new({ | |
| 47 | input => Plucene::Analysis::LowerCaseTokenizer->new(@_), | ||
| 48 | stoplist => \@stopwords | ||
| 49 | }); | ||
| 50 | } | ||
| 51 | |||
| 52 | 1 | 1; | |