line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CQL::Relation; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
2714
|
use strict; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
332
|
|
4
|
9
|
|
|
9
|
|
47
|
use warnings; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
410
|
|
5
|
9
|
|
|
9
|
|
11870
|
use Class::Accessor; |
|
9
|
|
|
|
|
24535
|
|
|
9
|
|
|
|
|
67
|
|
6
|
9
|
|
|
9
|
|
7987
|
use CQL::ModifierSet; |
|
9
|
|
|
|
|
24
|
|
|
9
|
|
|
|
|
296
|
|
7
|
9
|
|
|
9
|
|
56
|
use base qw( CQL::Node ); |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
6774
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
CQL::Relation - object for CQL Relations |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
CQL::Relation represents the common CQL relation operations ( =, E, |
18
|
|
|
|
|
|
|
E, any, all and exact. In addition modifiers may be applied (stem, |
19
|
|
|
|
|
|
|
relevant, fuzzy, phonetic). The operators are passed into the constructor |
20
|
|
|
|
|
|
|
as the base relation. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 METHODS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head2 new() |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Creates a new CQL::Relation object with the specified base relation. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub new { |
31
|
91
|
|
|
91
|
1
|
2341
|
my ($class,$base) = @_; |
32
|
91
|
|
|
|
|
399
|
my $ms = CQL::ModifierSet->new( $base ); |
33
|
91
|
|
33
|
|
|
810
|
return bless { modifierSet => $ms }, ref($class) || $class; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 getBase() |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Returns the base relation with which the CQL::Relation object was originally |
39
|
|
|
|
|
|
|
created. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub getBase { |
44
|
5
|
|
|
5
|
1
|
33
|
return shift->{modifierSet}->getBase(); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 addModifier() |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Adds a new relation modifier to the specified CQLRelation. |
50
|
|
|
|
|
|
|
Typical relation modifiers include relevant, fuzzy stem and phonetic. |
51
|
|
|
|
|
|
|
On the whole, these modifiers have a meaningful interpretation |
52
|
|
|
|
|
|
|
only for the text relations. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub addModifier { |
57
|
13
|
|
|
13
|
1
|
576
|
my ($self,$modifier) = @_; |
58
|
13
|
|
|
|
|
60
|
$self->{modifierSet}->addModifier( undef, $modifier ); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 getModifiers() |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Returns a list of modifiers associated with a CQL relation. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub getModifiers { |
68
|
11
|
|
|
11
|
1
|
50
|
return shift->{modifierSet}->getModifiers(); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 toCQL() |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub toCQL { |
76
|
47
|
|
|
47
|
1
|
297
|
return shift->{modifierSet}->toCQL(); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 toSwish() |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=cut |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub toSwish { |
84
|
2
|
|
|
2
|
1
|
9
|
return shift->{modifierSet}->toSwish(); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head2 toXCQL() |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=cut |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub toXCQL { |
92
|
2
|
|
|
2
|
1
|
8
|
my ($self,$level) = @_; |
93
|
2
|
|
|
|
|
12
|
my $xml = $self->{modifierSet}->toXCQL( $level, "relation" ); |
94
|
2
|
|
|
|
|
27
|
return $self->addNamespace( $level, $xml ); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 toLucene() |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub toLucene { |
102
|
0
|
|
|
0
|
1
|
|
return shift->{modifierSet}->toLucene(); |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
1; |