my ($self, $args) = @_;
my @terms = $self->_substring_terms($args);
- $args->{term} = '(' . join("\n\tOR ", @terms) . ')';
+ $args->{term} = @terms ? '(' . join("\n\tOR ", @terms) . ')' : '';
}
sub _allwordssubstr {
my ($self, $args) = @_;
my @terms = $self->_substring_terms($args);
- $args->{term} = '(' . join("\n\tAND ", @terms) . ')';
+ $args->{term} = @terms ? '(' . join("\n\tAND ", @terms) . ')' : '';
}
sub _nowordssubstr {
# Because _word_terms uses AND, we need to parenthesize its terms
# if there are more than one.
@terms = map("($_)", @terms) if scalar(@terms) > 1;
- $args->{term} = '(' . join("\n\tOR ", @terms) . ')';
+ $args->{term} = @terms ? '(' . join("\n\tOR ", @terms) . ')' : '';
}
sub _allwords {
my ($self, $args) = @_;
my @terms = $self->_word_terms($args);
- $args->{term} = '(' . join("\n\tAND ", @terms) . ')';
+ $args->{term} = @terms ? '(' . join("\n\tAND ", @terms) . ')' : '';
}
sub _nowords {