line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package String::Normal::Config; |
2
|
9
|
|
|
9
|
|
31
|
use strict; |
|
9
|
|
|
|
|
12
|
|
|
9
|
|
|
|
|
199
|
|
3
|
9
|
|
|
9
|
|
63
|
use warnings; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
183
|
|
4
|
|
|
|
|
|
|
|
5
|
9
|
|
|
9
|
|
3452
|
use String::Normal::Config::BusinessStem; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
175
|
|
6
|
9
|
|
|
9
|
|
3106
|
use String::Normal::Config::BusinessStop; |
|
9
|
|
|
|
|
12
|
|
|
9
|
|
|
|
|
193
|
|
7
|
9
|
|
|
9
|
|
3519
|
use String::Normal::Config::BusinessCompress; |
|
9
|
|
|
|
|
22
|
|
|
9
|
|
|
|
|
187
|
|
8
|
9
|
|
|
9
|
|
3155
|
use String::Normal::Config::AddressStem; |
|
9
|
|
|
|
|
15
|
|
|
9
|
|
|
|
|
190
|
|
9
|
9
|
|
|
9
|
|
2996
|
use String::Normal::Config::AddressStop; |
|
9
|
|
|
|
|
12
|
|
|
9
|
|
|
|
|
205
|
|
10
|
9
|
|
|
9
|
|
3238
|
use String::Normal::Config::States; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
253
|
|
11
|
9
|
|
|
9
|
|
3061
|
use String::Normal::Config::AreaCodes; |
|
9
|
|
|
|
|
12
|
|
|
9
|
|
|
|
|
173
|
|
12
|
9
|
|
|
9
|
|
3049
|
use String::Normal::Config::TitleStem; |
|
9
|
|
|
|
|
13
|
|
|
9
|
|
|
|
|
173
|
|
13
|
9
|
|
|
9
|
|
3063
|
use String::Normal::Config::TitleStop; |
|
9
|
|
|
|
|
11
|
|
|
9
|
|
|
|
|
2457
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub _slurp { |
16
|
14
|
|
|
14
|
|
22
|
my $fh = shift; |
17
|
14
|
|
|
|
|
23
|
my @data = (); |
18
|
14
|
100
|
|
|
|
1123
|
chomp( @data = map { $_ || () } map { split /\s+/, $_, 2 } <$fh> ); |
|
7518
|
|
|
|
|
11649
|
|
|
3759
|
|
|
|
|
4797
|
|
19
|
14
|
|
|
|
|
673
|
close $fh; |
20
|
14
|
|
|
|
|
2216
|
return @data; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _expand_ranges { |
24
|
3
|
|
|
3
|
|
7
|
my @expanded = (); |
25
|
|
|
|
|
|
|
|
26
|
3
|
|
|
|
|
9
|
for my $line (@_) { |
27
|
625
|
|
|
|
|
615
|
my @ranges = map { /(\w)-?(\w)/;[$1..$2] } $line =~ /\[(\w-?\w)+\]/g; |
|
32
|
|
|
|
|
42
|
|
|
32
|
|
|
|
|
183
|
|
28
|
625
|
|
|
|
|
486
|
$line =~ s/\[.*//; |
29
|
625
|
|
|
|
|
613
|
_expand( \my @results, $line, @ranges ); |
30
|
625
|
|
|
|
|
790
|
push @expanded, @results; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
3
|
|
|
|
|
137
|
return @expanded; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub _expand { |
37
|
1133
|
|
|
1133
|
|
901
|
my ($results,$str,$car,@cdr) = @_; |
38
|
|
|
|
|
|
|
|
39
|
1133
|
100
|
|
|
|
1385
|
if (ref $car ne 'ARRAY') { |
40
|
1101
|
|
|
|
|
855
|
push @$results, $str; |
41
|
1101
|
|
|
|
|
1013
|
return; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
32
|
|
|
|
|
36
|
for (@$car) { |
45
|
508
|
|
|
|
|
585
|
_expand( $results, $str . $_, @cdr ); |
46
|
|
|
|
|
|
|
}; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub _attach { |
50
|
3338
|
|
|
3338
|
|
2789
|
my ($t, $car, @cdr) = @_; |
51
|
3338
|
100
|
|
|
|
5238
|
return unless defined $car; |
52
|
2237
|
100
|
|
|
|
3366
|
$t->{$car} = {} unless ref $t->{$car}; |
53
|
2237
|
|
|
|
|
2422
|
_attach( $t->{$car}, @cdr ); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |