line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::JA::OkapiBM25::Result; |
2
|
3
|
|
|
3
|
|
13
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
86
|
|
3
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
71
|
|
4
|
3
|
|
|
3
|
|
15
|
use base qw(Lingua::JA::TFIDF::Result); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
4626
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub list { |
8
|
|
|
|
|
|
|
my $self = shift; |
9
|
|
|
|
|
|
|
my $num = shift; |
10
|
|
|
|
|
|
|
my @list; |
11
|
|
|
|
|
|
|
my $data = $self->{data}; |
12
|
|
|
|
|
|
|
my ( $word, $ref ) = each %$data; |
13
|
|
|
|
|
|
|
my $label = 'bm25'; |
14
|
|
|
|
|
|
|
my $i = 0; |
15
|
|
|
|
|
|
|
for ( |
16
|
|
|
|
|
|
|
sort { $data->{$b}->{$label} <=> $data->{$a}->{$label} } |
17
|
|
|
|
|
|
|
keys %{ $self->{data} } |
18
|
|
|
|
|
|
|
) |
19
|
|
|
|
|
|
|
{ |
20
|
|
|
|
|
|
|
push( @list, { $_ => $data->{$_}->{$label} } ); |
21
|
|
|
|
|
|
|
$i++; |
22
|
|
|
|
|
|
|
last if $num and $i == $num; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
return \@list; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
__END__ |