line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::JA::DocumentFrequency::AozoraBunko; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
49195
|
use 5.008001; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
134
|
|
4
|
4
|
|
|
4
|
|
21
|
use strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
176
|
|
5
|
4
|
|
|
4
|
|
30
|
use warnings; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
117
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
17
|
use Carp (); |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
79
|
|
8
|
4
|
|
|
4
|
|
18
|
use Exporter qw/import/; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
119
|
|
9
|
4
|
|
|
4
|
|
2530
|
use Storable (); |
|
4
|
|
|
|
|
11322
|
|
|
4
|
|
|
|
|
102
|
|
10
|
4
|
|
|
4
|
|
2241
|
use File::ShareDir (); |
|
4
|
|
|
|
|
21960
|
|
|
4
|
|
|
|
|
629
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.00_01'; |
13
|
|
|
|
|
|
|
our @EXPORT = qw(aozora_df); |
14
|
|
|
|
|
|
|
our @EXPORT_OK = qw(number_of_documents df); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my $DATA_PATH = File::ShareDir::dist_file('Lingua-JA-DocumentFrequency-AozoraBunko', 'df.st'); |
17
|
|
|
|
|
|
|
my $DF_OF = Storable::retrieve($DATA_PATH) or Carp::croak("Cannot read: $DATA_PATH"); |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
1
|
10
|
sub number_of_documents { 11176 } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub df |
22
|
|
|
|
|
|
|
{ |
23
|
12
|
|
|
12
|
1
|
21
|
my $word = shift; |
24
|
12
|
100
|
|
|
|
34
|
return undef unless defined $word; |
25
|
8
|
100
|
|
|
|
51
|
return defined $DF_OF->{$word} ? $DF_OF->{$word} : 0; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
*aozora_df = \&df; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |