line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plucene::Analysis::Tokenizer; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Plucene::Analysis::Tokenizer - base class for tokenizers |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $tokenizer = Plucene::Analysis::Tokenizer::Subclass |
10
|
|
|
|
|
|
|
->new({ reader => $reader }); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 DESCRIPTION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
This is an abstract base class for tokenizers. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
A Tokenizer is a TokenStream whose input is a Reader. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 METHODS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head2 new |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $tokenizer = Plucene::Analysis::Tokenizer::Subclass |
23
|
|
|
|
|
|
|
->new({ reader => $reader }); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
This will create a new tokenizer. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=cut |
28
|
|
|
|
|
|
|
|
29
|
19
|
|
|
19
|
|
120
|
use strict; |
|
19
|
|
|
|
|
41
|
|
|
19
|
|
|
|
|
730
|
|
30
|
19
|
|
|
19
|
|
99
|
use warnings; |
|
19
|
|
|
|
|
38
|
|
|
19
|
|
|
|
|
576
|
|
31
|
|
|
|
|
|
|
|
32
|
19
|
|
|
19
|
|
108
|
use base qw/Class::Accessor::Fast/; |
|
19
|
|
|
|
|
58
|
|
|
19
|
|
|
|
|
3414
|
|
33
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw[ reader ]); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 next |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
This must be defined in a subclass |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
0
|
1
|
0
|
sub next { die "next must define this in a subclass" } |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 close |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Close the input reader. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub close { |
50
|
3
|
|
|
3
|
1
|
1099
|
my $self = shift; |
51
|
3
|
50
|
|
|
|
44
|
$self->{reader}->close if $self->{reader}; |
52
|
3
|
|
|
|
|
17
|
return 1; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |