1package Plucene::Search::PhraseScorer::Exact; 2 3=head1 NAME 4 5Plucene::Search::PhraseScorer::Exact - exact phrase scorer 6 7=head1 SYNOPSIS 8 9 # isa Plucene::Search::PhraseScorer 10 11=head1 DESCRIPTION 12 13This is the eact phrase scorer 14 15=cut 16 17use strict; 18use warnings; 19 20use base 'Plucene::Search::PhraseScorer'; 21 22sub _phrase_freq { 23 my $self = shift; 24 my $pp = $self->first; 25 while ($pp) { 26 $pp->first_position; 27 push @{ $self->{pq} }, $pp; 28 $pp = $pp->next_in_list; 29 } 30 31 $self->_pq_to_list; 32 33 my $freq = 0; 34 do { 35 while ($self->first->position < $self->last->position) { 36 do { 37 return $freq unless $self->first->next_position; 38 } while $self->first->position < $self->last->position; 39 $self->_first_to_last; 40 } 41 $freq++; 42 } while $self->last->next_position; 43 return $freq; 44} 45 461; 47