line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package KinoSearch1::Search::BooleanClause; |
2
|
18
|
|
|
18
|
|
99
|
use strict; |
|
18
|
|
|
|
|
39
|
|
|
18
|
|
|
|
|
612
|
|
3
|
18
|
|
|
18
|
|
99
|
use warnings; |
|
18
|
|
|
|
|
37
|
|
|
18
|
|
|
|
|
434
|
|
4
|
18
|
|
|
18
|
|
106
|
use KinoSearch1::Util::ToolSet; |
|
18
|
|
|
|
|
35
|
|
|
18
|
|
|
|
|
2611
|
|
5
|
18
|
|
|
18
|
|
110
|
use base qw( KinoSearch1::Util::Class ); |
|
18
|
|
|
|
|
35
|
|
|
18
|
|
|
|
|
1660
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
BEGIN { |
8
|
18
|
|
|
18
|
|
165
|
__PACKAGE__->init_instance_vars( |
9
|
|
|
|
|
|
|
occur => 'SHOULD', |
10
|
|
|
|
|
|
|
query => undef, |
11
|
|
|
|
|
|
|
); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub init_instance { |
15
|
524
|
|
|
524
|
1
|
1062
|
my $self = shift; |
16
|
|
|
|
|
|
|
|
17
|
524
|
50
|
|
|
|
3367
|
croak("invalid value for 'occur': '$self->{occur}'") |
18
|
|
|
|
|
|
|
unless $self->{occur} =~ /^(?:MUST|MUST_NOT|SHOULD)$/; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
__PACKAGE__->ready_get_set(qw( occur query )); |
22
|
|
|
|
|
|
|
|
23
|
52
|
|
|
52
|
0
|
368
|
sub is_required { shift->{occur} eq 'MUST' } |
24
|
0
|
|
|
0
|
0
|
|
sub is_prohibited { shift->{occur} eq 'MUST_NOT' } |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my %string_representations = ( |
27
|
|
|
|
|
|
|
MUST => '+', |
28
|
|
|
|
|
|
|
MUST_NOT => '-', |
29
|
|
|
|
|
|
|
SHOULD => '', |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub to_string { |
33
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
34
|
0
|
|
|
|
|
|
my $string = $string_representations{"$self->{occur}"} |
35
|
|
|
|
|
|
|
. $self->{query}->to_string; |
36
|
0
|
|
|
|
|
|
return $string; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |