| 1 | package CQL::Relation; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 9 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 9 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 9 | ▶ | use Class::Accessor; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 9 | ▶ | use CQL::ModifierSet; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 9 | ▶ | use base qw( CQL::Node ); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 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<gt>, | ||||||||||||||||||||
| 18 | E<lt>, 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 | 91 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.6
Pod
documented
| |||||||||||||||||||||
| 31 | 91 | my ($class,$base) = @_; | |||||||||||||||||||
| 32 | 91 | my $ms = CQL::ModifierSet->new( $base ); | |||||||||||||||||||
| 33 | 91 | ▶ | return bless { modifierSet => $ms }, ref($class) || $class; | ||||||||||||||||||
|
Condition33%1/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table33%1/3
A || B
A= ref $classB= $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 | 5 | ▶ | sub getBase { | ||||||||||||||||||
|
Subroutine
getBase: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 44 | 5 | 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 | 13 | ▶ | sub addModifier { | ||||||||||||||||||
|
Subroutine
addModifier: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 57 | 13 | my ($self,$modifier) = @_; | |||||||||||||||||||
| 58 | 13 | $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 | 11 | ▶ | sub getModifiers { | ||||||||||||||||||
|
Subroutine
getModifiers: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 68 | 11 | return shift->{modifierSet}->getModifiers(); | |||||||||||||||||||
| 69 | } | ||||||||||||||||||||
| 70 | |||||||||||||||||||||
| 71 | =head2 toCQL() | ||||||||||||||||||||
| 72 | |||||||||||||||||||||
| 73 | =cut | ||||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | 47 | ▶ | sub toCQL { | ||||||||||||||||||
|
Subroutine
toCQL: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 76 | 47 | return shift->{modifierSet}->toCQL(); | |||||||||||||||||||
| 77 | } | ||||||||||||||||||||
| 78 | |||||||||||||||||||||
| 79 | =head2 toSwish() | ||||||||||||||||||||
| 80 | |||||||||||||||||||||
| 81 | =cut | ||||||||||||||||||||
| 82 | |||||||||||||||||||||
| 83 | 2 | ▶ | sub toSwish { | ||||||||||||||||||
|
Subroutine
toSwish: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 84 | 2 | return shift->{modifierSet}->toSwish(); | |||||||||||||||||||
| 85 | } | ||||||||||||||||||||
| 86 | |||||||||||||||||||||
| 87 | =head2 toXCQL() | ||||||||||||||||||||
| 88 | |||||||||||||||||||||
| 89 | =cut | ||||||||||||||||||||
| 90 | |||||||||||||||||||||
| 91 | 2 | ▶ | sub toXCQL { | ||||||||||||||||||
|
Subroutine
toXCQL: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 92 | 2 | my ($self,$level) = @_; | |||||||||||||||||||
| 93 | 2 | my $xml = $self->{modifierSet}->toXCQL( $level, "relation" ); | |||||||||||||||||||
| 94 | 2 | return $self->addNamespace( $level, $xml ); | |||||||||||||||||||
| 95 | } | ||||||||||||||||||||
| 96 | |||||||||||||||||||||
| 97 | =head2 toLucene() | ||||||||||||||||||||
| 98 | |||||||||||||||||||||
| 99 | =cut | ||||||||||||||||||||
| 100 | |||||||||||||||||||||
| 101 | 0 | ▶ | sub toLucene { | ||||||||||||||||||
|
Subroutine
toLucene: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 102 | 0 | return shift->{modifierSet}->toLucene(); | |||||||||||||||||||
| 103 | } | ||||||||||||||||||||
| 104 | |||||||||||||||||||||
| 105 | 9 | 1; | |||||||||||||||||||