line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Magrathea::API::Abbreviation; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
5
|
1
|
|
|
1
|
|
12
|
use 5.10.0; |
|
1
|
|
|
|
|
5
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use parent qw{ Exporter }; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
16
|
|
8
|
1
|
|
|
1
|
|
648
|
use Text::Autoformat; |
|
1
|
|
|
|
|
20413
|
|
|
1
|
|
|
|
|
73
|
|
9
|
1
|
|
|
1
|
|
9
|
use Data::Dumper; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
239
|
|
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__ |