line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Magrathea::API::Abbreviation; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
11
|
use 5.10.0; |
|
1
|
|
|
|
|
4
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use parent qw{ Exporter }; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
17
|
|
8
|
1
|
|
|
1
|
|
637
|
use Text::Autoformat; |
|
1
|
|
|
|
|
20075
|
|
|
1
|
|
|
|
|
65
|
|
9
|
1
|
|
|
1
|
|
9
|
use Data::Dumper; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
231
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT_OK = qw{ abbreviate }; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub abbreviate($) |
14
|
|
|
|
|
|
|
{ |
15
|
0
|
|
|
0
|
0
|
|
my $check = shift; |
16
|
0
|
|
|
|
|
|
local $_; |
17
|
0
|
|
|
|
|
|
my $wanted = autoformat $check, { |
18
|
|
|
|
|
|
|
case => 'highlight' |
19
|
|
|
|
|
|
|
}; |
20
|
0
|
|
|
|
|
|
$wanted =~ s/\s*$//; |
21
|
0
|
|
|
|
|
|
study $wanted; |
22
|
0
|
|
|
|
|
|
while () { |
23
|
0
|
|
|
|
|
|
chomp; |
24
|
0
|
|
|
|
|
|
s/#.*//; |
25
|
0
|
0
|
|
|
|
|
next if /^$/; |
26
|
0
|
|
|
|
|
|
my ($key, $val) = split /\t/; |
27
|
0
|
|
|
|
|
|
$wanted =~ s/\b$key\b/$val./g; |
28
|
|
|
|
|
|
|
} |
29
|
0
|
|
|
|
|
|
$wanted =~ s/\band\b/&/g; |
30
|
0
|
|
|
|
|
|
$wanted =~ s/\.\.$/./; |
31
|
0
|
|
|
|
|
|
return $wanted; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__DATA__ |