line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Magrathea::API::Abbreviation; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
4
|
1
|
|
|
1
|
|
13
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
30
|
|
5
|
1
|
|
|
1
|
|
10
|
use 5.10.0; |
|
1
|
|
|
|
|
3
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
9
|
use parent qw{ Exporter }; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
8
|
1
|
|
|
1
|
|
651
|
use Text::Autoformat; |
|
1
|
|
|
|
|
20169
|
|
|
1
|
|
|
|
|
58
|
|
9
|
1
|
|
|
1
|
|
7
|
use Data::Dumper; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
221
|
|
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__ |