line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::JA::DocumentFrequency::AozoraBunko; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
49300
|
use 5.008001; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
153
|
|
4
|
4
|
|
|
4
|
|
23
|
use strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
138
|
|
5
|
4
|
|
|
4
|
|
30
|
use warnings; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
113
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
14
|
use Carp (); |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
66
|
|
8
|
4
|
|
|
4
|
|
14
|
use Exporter qw/import/; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
105
|
|
9
|
4
|
|
|
4
|
|
2401
|
use Storable (); |
|
4
|
|
|
|
|
10425
|
|
|
4
|
|
|
|
|
85
|
|
10
|
4
|
|
|
4
|
|
1874
|
use File::ShareDir (); |
|
4
|
|
|
|
|
20564
|
|
|
4
|
|
|
|
|
732
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.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
|
13
|
sub number_of_documents { 11176 } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub df |
22
|
|
|
|
|
|
|
{ |
23
|
12
|
|
|
12
|
1
|
22
|
my $word = shift; |
24
|
12
|
100
|
|
|
|
37
|
return undef unless defined $word; |
25
|
8
|
100
|
|
|
|
49
|
return defined $DF_OF->{$word} ? $DF_OF->{$word} : 0; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
*aozora_df = \&df; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |