line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plucene::Analysis::Standard::StandardAnalyzer; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Plucene::Analysis::Standard::StandardAnalyzer - standard analyzer |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my Plucene::Analysis::Stopfilter $sf = |
10
|
|
|
|
|
|
|
Plucene::Analysis::Standard::StandardAnalyzer->tokenstream(@args); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 DESCRIPTION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
The standard analyzer, built with a list of stop words. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
This list of stop words are: |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
"a", "and", "are", "as", "at", "be", "but", "by", |
19
|
|
|
|
|
|
|
"for", "if", "in", "into", "is", "it", "no", "not", |
20
|
|
|
|
|
|
|
"of", "on", "or", "s", "such", "t", "that", "the", |
21
|
|
|
|
|
|
|
"their", "then", "there", "these", "they", "this", "to", "was", |
22
|
|
|
|
|
|
|
"will", "with" |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 METHODS |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
1
|
|
43458
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
29
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
1
|
|
5
|
use base 'Plucene::Analysis::Analyzer'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
539
|
|
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
1
|
|
533
|
use Plucene::Analysis::Standard::StandardTokenizer; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
23
|
|
34
|
1
|
|
|
1
|
|
638
|
use Plucene::Analysis::StopFilter; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
13
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my @stopwords = ( |
37
|
|
|
|
|
|
|
"a", "and", "are", "as", "at", "be", "but", "by", |
38
|
|
|
|
|
|
|
"for", "if", "in", "into", "is", "it", "no", "not", |
39
|
|
|
|
|
|
|
"of", "on", "or", "s", "such", "t", "that", "the", |
40
|
|
|
|
|
|
|
"their", "then", "there", "these", "they", "this", "to", "was", |
41
|
|
|
|
|
|
|
"will", "with" |
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 tokenstream |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my Plucene::Analysis::Stopfilter $sf = |
47
|
|
|
|
|
|
|
Plucene::Analysis::Standard::StandardAnalyzer->tokenstream(@args); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub tokenstream { |
52
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
53
|
0
|
|
|
|
|
|
return Plucene::Analysis::StopFilter->new({ |
54
|
|
|
|
|
|
|
input => Plucene::Analysis::Standard::StandardTokenizer->new(@_), |
55
|
|
|
|
|
|
|
stoplist => \@stopwords |
56
|
|
|
|
|
|
|
}); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |