line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::AM::Abbreviate; |
2
|
|
|
|
|
|
|
require 5.000; |
3
|
|
|
|
|
|
|
require Exporter; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
6
|
|
|
|
|
|
|
@EXPORT = qw( |
7
|
|
|
|
|
|
|
Contract |
8
|
|
|
|
|
|
|
Expand |
9
|
|
|
|
|
|
|
); |
10
|
|
|
|
|
|
|
$VERSION = '0.01'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
%AbbreviatedAmharic = ( |
14
|
|
|
|
|
|
|
'ት/ቤት' => 'ትምህርት ቤት', |
15
|
|
|
|
|
|
|
'ጽ/ቤት' => 'ጽህፈት ቤት', |
16
|
|
|
|
|
|
|
'ም/ቤት' => 'ምክር ቤት', |
17
|
|
|
|
|
|
|
'መ/ቤት' => 'መሥሪያ ቤት', |
18
|
|
|
|
|
|
|
'ፍ/ቤት' => 'ፍርድ ቤት', |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
'ሠ/ፌዴሬሽን' => 'ሠራተኛ ፌዴሬሽን', |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
'ቤ/ክ' => 'ቤተክርስትያን', |
23
|
|
|
|
|
|
|
'ቤ/መ' => 'ቤተመንግስት', |
24
|
|
|
|
|
|
|
'መ/ቅ' => 'መጸሐፍ ቅዱስ', |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
'ም/' => 'ምክትል', |
27
|
|
|
|
|
|
|
'ገ/' => 'ገብረ', |
28
|
|
|
|
|
|
|
'ወ/' => 'ወልደ', |
29
|
|
|
|
|
|
|
'ተ/' => 'ተክለ', # ወይም ተስፋ |
30
|
|
|
|
|
|
|
'ኃ/' => 'ኃይለ', |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
'ኮ/ል' => 'ኮለኔል', |
33
|
|
|
|
|
|
|
'ጄ/ል' => 'ጄኔራል', |
34
|
|
|
|
|
|
|
'ሻ/' => 'ሻምበል', |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
'ወ/ሮ' => 'ወይዘሮ', |
37
|
|
|
|
|
|
|
'ወ/ሪት' => 'ወይዘሪት', |
38
|
|
|
|
|
|
|
'ሚ/ር' => 'ሚስተር', |
39
|
|
|
|
|
|
|
'ሚ/ስ' => 'ሚስስ', |
40
|
|
|
|
|
|
|
'ፕ/ር' => 'ፕሮፌሰር', |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
'ፕ/ት' => 'ፕሬዚዳንት', |
43
|
|
|
|
|
|
|
'ጠ/ሚ' => 'ጠቅላይ ሚኒስትር', |
44
|
|
|
|
|
|
|
'ጠ/ሚኒስትር' => 'ጠቅላይ ሚኒስትር', |
45
|
|
|
|
|
|
|
'ጠ/ሚ/ቢሮ' => 'ጠቅላይ ሚኒስትር ቢሮ', |
46
|
|
|
|
|
|
|
'ሚ/ሩ' => 'ሚኒስትሩ', |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
'ዓ/ም' => 'ዓመተ ምህረት', |
49
|
|
|
|
|
|
|
'ዓ/ዓ' => 'ዓመተ ዓለም', |
50
|
|
|
|
|
|
|
'አ/አ' => 'አዲስ አባባ', |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
'ዶ/ር' => 'ዶክተር', |
53
|
|
|
|
|
|
|
'ሆ/ል' => 'ሆስፒታል' |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub Expand |
58
|
|
|
|
|
|
|
{ |
59
|
3
|
|
|
3
|
0
|
26
|
local ($term) = $_[0]; |
60
|
|
|
|
|
|
|
|
61
|
3
|
100
|
|
|
|
12
|
if ( $AbbreviatedAmharic{$term} ) { |
62
|
2
|
|
|
|
|
26
|
return ( $AbbreviatedAmharic{$term} ); |
63
|
|
|
|
|
|
|
} else { |
64
|
1
|
|
|
|
|
8
|
$prefix = $term =~ s/^([ለበከየ])//; |
65
|
1
|
50
|
|
|
|
5
|
if ( $AbbreviatedAmharic{$term} ) { |
66
|
0
|
|
|
|
|
0
|
return ( "$prefix$AbbreviatedAmharic{$term}" ); |
67
|
|
|
|
|
|
|
} else { |
68
|
1
|
|
|
|
|
2
|
$term = $_[0]; |
69
|
1
|
|
|
|
|
5
|
($prefix, $term) = split ( /\//, $term, 2 ); |
70
|
1
|
|
|
|
|
2
|
$prefix .= "/"; |
71
|
1
|
50
|
|
|
|
6
|
if ( $AbbreviatedAmharic{$prefix} ) { |
72
|
1
|
|
|
|
|
6
|
return ( "$AbbreviatedAmharic{$prefix}$term" ); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub Contract |
81
|
|
|
|
|
|
|
{ |
82
|
1
|
|
|
1
|
0
|
5
|
local ($term) = shift; |
83
|
|
|
|
|
|
|
|
84
|
1
|
|
|
|
|
12
|
foreach $key (keys %AbbreviatedAmharic) { |
85
|
5
|
50
|
|
|
|
14
|
return ( $key ) if ( $AbbreviatedAmharic{$key} eq $term ); |
86
|
|
|
|
|
|
|
# print "Contract: $AbbreviatedAmharic{$key} = $term\n"; |
87
|
5
|
100
|
|
|
|
66
|
if ( $term =~ /^$AbbreviatedAmharic{$key}/ ) { |
88
|
1
|
|
|
|
|
8
|
$term =~ s/$AbbreviatedAmharic{$key}//; |
89
|
1
|
|
|
|
|
|
return ( "$key$term" ); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
# |
95
|
|
|
|
|
|
|
# ma/bEt |
96
|
|
|
|
|
|
|
# d/bEt |
97
|
|
|
|
|
|
|
# me/`se/ma |
98
|
|
|
|
|
|
|
# qe/ge/ma |
99
|
|
|
|
|
|
|
# m/wana as in "m/wana SeHefi" |
100
|
|
|
|
|
|
|
######################################################### |
101
|
|
|
|
|
|
|
# Do not change this, Do not put anything below this. |
102
|
|
|
|
|
|
|
# File must return "true" value at termination |
103
|
|
|
|
|
|
|
1; |
104
|
|
|
|
|
|
|
########################################################## |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
__END__ |