/usr/share/perl5/Plucene/Index/Term.pm is in libplucene-perl 1.25-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | package Plucene::Index::Term;
=head1 NAME
Plucene::Index::Term - a word from text
=head1 SYNOPSIS
my $term = Plucene::Index::Term->new({
field => $field_name,
text => $text,
});
# with two Plucene::Index::Term objects you can do:
if ($term1->eq($term2)) { ... }
# etc
=head1 DESCRIPTION
A Term represents a word from text, and is the unit of search. It is
composed of two elements, the text of the word, as a string, and the
name of the field that the text occured in, as a string.
Note that terms may represent more than words from text fields, but
also things like dates, email addresses, urls, etc.
=head1 METHODS
=cut
use strict;
use warnings;
no warnings 'uninitialized';
use base 'Class::Accessor::Fast';
__PACKAGE__->mk_accessors(qw(field text));
=head2 eq / ne / lt / gt / ge / le
Exactly what you would think they are.
=cut
sub _cmp {
($_[0]->{field} cmp $_[1]->{field}) || ($_[0]->{text} cmp $_[1]->{text});
}
sub eq {
$_[0]->{field} eq $_[1]->{field} && $_[0]->{text} eq $_[1]->{text};
}
sub ne {
$_[0]->{field} ne $_[1]->{field} || $_[0]->{text} ne $_[1]->{text};
}
sub lt {
($_[0]->{field} cmp $_[1]->{field} || $_[0]->{text} cmp $_[1]->{text}) < 0;
}
sub gt {
($_[0]->{field} cmp $_[1]->{field} || $_[0]->{text} cmp $_[1]->{text}) > 0;
}
sub ge {
($_[0]->{field} cmp $_[1]->{field} || $_[0]->{text} cmp $_[1]->{text}) >= 0;
}
sub le {
($_[0]->{field} cmp $_[1]->{field} || $_[0]->{text} cmp $_[1]->{text}) <= 0;
}
1;
|