line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Telugu::AsciiMap; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
56939
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
5
|
1
|
|
|
1
|
|
5
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.06'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# soon an updated version of this module will be uploaded to cpan. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my $eng = "\, \- \. \/ 0 1 2 3 4 5 6 7 8 9 \: \; \< \= \> \? \@ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \[ \\ \] \^ \_ \` a b c d e f g h i j k l m n o p q r s t u v w x y z \{ \| "; |
13
|
|
|
|
|
|
|
my $tel = "అ ఆ ఇ ఈ ఉ ఊ ఋ ౠ ఌ ౡ ఎ ఏ ఐ ఒ ఓ ఔ ం ః ఁ ్ క ఖ గ ఘ ఙ చ ఛ జ ఝ ఞ ట ఠ డ ఢ ణ త థ ద ధ న ప ఫ బ భ మ య ర ల వ శ ష స హ ళ ా ి ీ ు ూ ృ ౄ ౢ ౣ ె ే ై ొ ో ౌ ౦ ౧ ౨ ౩ ౪ ౫ ౬ ౭ ౮ ౯ ఓం"; |
14
|
|
|
|
|
|
|
my %hashente; |
15
|
|
|
|
|
|
|
my %hashteen; |
16
|
|
|
|
|
|
|
my @telugu = split(" ", $tel); |
17
|
|
|
|
|
|
|
my @english = split(" ", $eng ); |
18
|
|
|
|
|
|
|
@hashente{@english} = @telugu; |
19
|
|
|
|
|
|
|
@hashteen{@telugu} = @english; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
#%hashteen = ('అ' => ',', 'ఆ' => '-', 'ఇ' => '.', 'ఈ' => '/', 'ఉ' => '0', 'ఊ' => '1', 'ఋ' => '2', 'ౠ' => '3', 'ఌ' => '4', 'ౡ' => '5', 'ఎ' => '6', 'ఏ' => '7', 'ఐ' => '8', 'ఒ' => '9', 'ఓ' => ':', 'ఔ' => ';', 'ం' => '<', 'ః' => '=', 'ఁ' => '>', '్' => '?', 'క' => '@', 'ఖ' => 'A', 'గ' => 'B', 'ఘ' => 'C', 'ఙ' => 'D', 'చ' => 'E', 'ఛ' => 'F', 'జ' => 'G', 'ఝ' => 'H', 'ఞ' => 'I', 'ట' => 'J', 'ఠ' => 'K', 'డ' => 'L', 'ఢ' => 'M', 'ణ' => 'N', 'త' => 'O', 'థ' => 'P', 'ద' => 'Q', 'ధ' => 'R', 'న' => 'S', 'ప' => 'T', 'ఫ' => 'U', 'బ' => 'V', 'భ' => 'W', 'మ' => 'X', 'య' => 'Y', 'ర' => 'Z', 'ల' => '[', 'వ' => '\', 'శ' => ']', 'ష' => '^', 'స' => '_', 'హ' => '`', 'ళ' => 'a', 'ా' => 'b', 'ి' => 'c', 'ీ' => 'd', 'ు' => 'e', 'ూ' => 'f', 'ృ' => 'g', 'ౄ' => 'h', 'ౢ' => 'i', 'ౣ' => 'j', 'ె' => 'k', 'ే' => 'l', 'ై' => 'm', 'ొ' => 'n', 'ో' => 'o', 'ౌ' => 'p', '౦' => 'q', '౧' => 'r', '౨' => 's', '౩' => 't', '౪' => 'u', '౫' => 'v', '౬' => 'w', '౭' => 'x', '౮' => 'y', '౯' => 'z', 'ఓం' => '{'); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
#%hashente = (',' => 'అ', '-' => 'ఆ', '.' => 'ఇ', '/' => 'ఈ', '0' => 'ఉ', '1' => 'ఊ', '2' => 'ఋ', '3' => 'ౠ', '4' => 'ఌ', '5' => 'ౡ', '6' => 'ఎ', '7' => 'ఏ', '8' => 'ఐ', '9' => 'ఒ', ':' => 'ఓ', ';' => 'ఔ', '<' => 'ం', '=' => 'ః', '>' => 'ఁ', '?' => '్', '@' => 'క', 'A' => 'ఖ', 'B' => 'గ', 'C' => 'ఘ', 'D' => 'ఙ', 'E' => 'చ', 'F' => 'ఛ', 'G' => 'జ', 'H' => 'ఝ', 'I' => 'ఞ', 'J' => 'ట', 'K' => 'ఠ', 'L' => 'డ', 'M' => 'ఢ', 'N' => 'ణ', 'O' => 'త', 'P' => 'థ', 'Q' => 'ద', 'R' => 'ధ', 'S' => 'న', 'T' => 'ప', 'U' => 'ఫ', 'V' => 'బ', 'W' => 'భ', 'X' => 'మ', 'Y' => 'య', 'Z' => 'ర', '[' => 'ల', '\' => 'వ', ']' => 'శ', '^' => 'ష', '_' => 'స', '`' => 'హ', 'a' => 'ళ', 'b' => 'ా', 'c' => 'ి', 'd' => 'ీ', 'e' => 'ు', 'f' => 'ూ', 'g' => 'ృ', 'h' => 'ౄ', 'i' => 'ౢ', 'j' => 'ౣ', 'k' => 'ె', 'l' => 'ే', 'm' => 'ై', 'n' => 'ొ', 'o' => 'ో', 'p' => 'ౌ', 'q' => '౦', 'r' => '౧', 's' => '౨', 't' => '౩', 'u' => '౪', 'v' => '౫', 'w' => '౬', 'x' => '౭', 'y' => '౮', 'z' => '౯', '{' => 'ఓం'); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub new { |
27
|
1
|
|
|
1
|
0
|
70
|
my $class = shift; |
28
|
1
|
|
|
|
|
3
|
return bless {}, $class; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub convert { |
33
|
1
|
|
|
1
|
0
|
5
|
my $self = shift; |
34
|
1
|
|
|
|
|
1
|
my $string = shift; |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
2
|
my @convertedout; |
37
|
1
|
|
|
|
|
3
|
my %checkval = map { $_ => 1 } @telugu; |
|
80
|
|
|
|
|
113
|
|
38
|
1
|
|
|
|
|
9
|
my @stringsplit = split('', $string); |
39
|
1
|
|
|
|
|
4
|
for my $cv (0..$#stringsplit) { |
40
|
9
|
|
|
|
|
15
|
my $ordvalue = ord($stringsplit[$cv]); |
41
|
9
|
50
|
33
|
|
|
24
|
if ($ordvalue <= 3199 && $ordvalue >= 3072 ) { |
|
|
0
|
0
|
|
|
|
|
42
|
9
|
50
|
|
|
|
14
|
if(exists($checkval{$stringsplit[$cv]})) { |
43
|
9
|
|
|
|
|
19
|
push @convertedout, $hashteen{$stringsplit[$cv]}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
else { |
46
|
0
|
|
|
|
|
0
|
push @convertedout, $stringsplit[$cv]; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
elsif ($ordvalue <= 124 && $ordvalue >= 44 ){ |
50
|
0
|
|
|
|
|
0
|
push @convertedout, $hashente{$stringsplit[$cv]}; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
else { |
53
|
0
|
|
|
|
|
0
|
push @convertedout, $stringsplit[$cv]; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
1
|
|
|
|
|
8
|
return join("", @convertedout); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub deconvert { |
61
|
1
|
|
|
1
|
0
|
4
|
my $self = shift; |
62
|
1
|
|
|
|
|
2
|
my $string = shift; |
63
|
|
|
|
|
|
|
|
64
|
1
|
|
|
|
|
1
|
my @convertedout; |
65
|
1
|
|
|
|
|
13
|
my @stringsplit = split('', $string); |
66
|
1
|
|
|
|
|
4
|
for my $cv (0..$#stringsplit) { |
67
|
9
|
|
|
|
|
13
|
my $ordvalue = ord($stringsplit[$cv]); |
68
|
9
|
50
|
33
|
|
|
21
|
if ($ordvalue <= 124 && $ordvalue >= 44 ) { |
|
|
0
|
0
|
|
|
|
|
69
|
9
|
|
|
|
|
20
|
push @convertedout, $hashente{$stringsplit[$cv]}; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
elsif ($ordvalue <= 3199 && $ordvalue >= 3072 ){ |
72
|
0
|
|
|
|
|
0
|
push @convertedout, $hashteen{$stringsplit[$cv]}; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
else { |
75
|
0
|
|
|
|
|
0
|
push @convertedout, $stringsplit[$cv]; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
} |
78
|
1
|
|
|
|
|
6
|
return join("", @convertedout); |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |
82
|
|
|
|
|
|
|
__END__ |