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