This file is indexed.

/usr/share/perl5/Plucene/Index/SegmentTermEnum.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
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
package Plucene::Index::SegmentTermEnum;

=head1 NAME 

Plucene::Index::SegmentTermEnum - Segment term enum

=head1 SYNOPSIS

	my $seg_term_enum = Plucene::Index::SegmentTermEnum
	 	->new(  Plucene::Store::InputStream $i, 
			Plucene::Index::FieldInfos  $fi, 
			$is_index);

	my $clone = $seg_term_info->clone;

	my Plucene::Index::Term $term = $seg_term_enum->read_term;

	$seg_term_info->seek($ptr, $position, $term, $term_info);
	$seg_term_enum->prev;
	$seg_term_enum->next;

=head1 DESCRIPTION

This is the segment term enum class.

=head1 METHODS

=cut

use strict;
use warnings;

use Plucene::Index::TermInfo;
use Plucene::Index::Term;

use base 'Class::Accessor::Fast';

__PACKAGE__->mk_accessors(qw(term term_info index_pointer size position));

=head2 new

	my $seg_term_enum = Plucene::Index::SegmentTermEnum
	 	->new(  Plucene::Store::InputStream $i, 
			Plucene::Index::FieldInfos  $fi, 
			$is_index);

=head2 term / term_info / index_pointer / size / position 
	/ doc_freq / freq_pointer / prox_pointer

Get / set these attributes.
			
=cut

sub doc_freq     { shift->{term_info}->doc_freq(@_) }
sub freq_pointer { shift->{term_info}->freq_pointer(@_) }
sub prox_pointer { shift->{term_info}->prox_pointer(@_) }

# term_info must return a clone

sub new {
	my ($class, $i, $fis, $is_i) = @_;
	bless {
		input       => $i,
		field_infos => $fis,
		is_index    => $is_i,
		position    => -1,
		term        => Plucene::Index::Term->new(),
		term_info   => Plucene::Index::TermInfo->new(),
		size        => $i->read_int
	}, $class;
}

=head2 clone

	my $clone = $seg_term_info->clone;

=cut

sub clone {
	my $self = shift;
	my $clone = bless { %$self, input => $self->{input}->clone, }, ref $self;
	$clone->{buffer} = $self->{term}->text if $self->{term};
	return $clone;
}

=head2 seek

	$seg_term_info->seek($ptr, $position, $term, $term_info);

=cut

sub seek {
	my ($self, $ptr, $p, $t, $ti) = @_;
	$self->{input}->seek($ptr, 0);
	$self->{position} = $p;
	$self->{term}     = $t;
	undef $self->{prev};
	$self->{term_info} = $ti->clone;
	$self->{buffer}    = $t->text;
}

=head2 prev / next

	$seg_term_enum->prev;
	$seg_term_enum->next;

=cut

sub prev { return $_[0]->{prev} }

sub next {
	my $self = shift;
	if ($self->{position}++ >= $self->{size} - 1) {
		undef $self->{term};
		return;
	}
	$self->{prev}                  = $self->{term};
	$self->{term}                  = $self->read_term();
	$self->{term_info}->{doc_freq} = $self->{input}->read_vint;
	$self->{term_info}->{freq_pointer} += $self->{input}->read_vlong;
	$self->{term_info}->{prox_pointer} += $self->{input}->read_vlong;
	$self->{index_pointer} += $self->{input}->read_vlong if $self->{is_index};
	return 1;
}

=head2 read_term

	my Plucene::Index::Term $term = $seg_term_enum->read_term;

=cut

sub read_term {
	my $self   = shift;
	my $start  = $self->{input}->read_vint();
	my $length = $self->{input}->read_vint();
	$self->{buffer} ||= " " x $length;
	$self->{input}->read(substr($self->{buffer}, $start, $length), $length);
	$self->{buffer} = substr($self->{buffer}, 0, $start + $length);
	return bless {
		text  => $self->{buffer},
		field => $self->{field_infos}->field_name($self->{input}->read_vint),
	} => 'Plucene::Index::Term';
}

1;