line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Telugu::AsciiMap; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
59113
|
use Mouse; |
|
1
|
|
|
|
|
25967
|
|
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
334
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
5
|
1
|
|
|
1
|
|
520
|
use Kavorka -all; |
|
1
|
|
|
|
|
12151
|
|
|
1
|
|
|
|
|
9
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.09'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has 'TeMap' => ( |
11
|
|
|
|
|
|
|
is => 'ro', |
12
|
|
|
|
|
|
|
isa => 'HashRef', |
13
|
|
|
|
|
|
|
default => sub { |
14
|
|
|
|
|
|
|
return {'à°
' => ',', 'à°' => '-', 'à°' => '.', 'à°' => '/', 'à°' => '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', 'à°à°' => '{' |
15
|
|
|
|
|
|
|
, ',' => 'à°
', '-' => 'à°', '.' => 'à°', '/' => 'à°', '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' => '౯', '{' => 'à°à°'}; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
1
|
50
|
|
1
|
|
271317
|
method asciimap($string) { |
|
1
|
50
|
|
2
|
|
2
|
|
|
1
|
50
|
|
|
|
270
|
|
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
3
|
|
20
|
2
|
|
|
|
|
8
|
my @stringsplit = split('', $string); |
21
|
2
|
|
|
|
|
3
|
my @out; |
22
|
2
|
|
|
|
|
5
|
for my $c (0..$#stringsplit) { |
23
|
32
|
50
|
|
|
|
52
|
if( defined($self->TeMap->{$stringsplit[$c]}) ) { |
24
|
32
|
|
|
|
|
52
|
push @out, $self->TeMap->{$stringsplit[$c]}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
else { |
27
|
0
|
|
|
|
|
0
|
push @out, $stringsplit[$c]; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
2
|
|
|
|
|
10
|
return join("", @out); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
__END__ |
35
|
|
|
|
|
|
|
=encoding utf-8 |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 NAME |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Telugu::AsciiMap - Map Telugu chars to ascii chars to save space |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 SYNOPSIS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
use Telugu::AsciiMap; |
44
|
|
|
|
|
|
|
use utf8; |
45
|
|
|
|
|
|
|
binmode STDOUT, ":encoding(UTF-8)"; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
my $map = Telugu::AsciiMap->new(); |
48
|
|
|
|
|
|
|
my $asciistring = $map->asciimap('à°°à°¾à°à±à°à±à°®à°¾à°°à±à°°à±à°¡à±à°¡à°¿'); # use asciimap method to convert telugu text to ascii |
49
|
|
|
|
|
|
|
my $telugustring = $map->asciimap($asciistring); # use the same method to convet back ascii text to telugu |
50
|
|
|
|
|
|
|
print $asciistring, "\n", $telugustring, "\n"; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 DESCRIPTION |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Each Telugu char uses four times the space required for an ascii char. |
56
|
|
|
|
|
|
|
This module provides a function to convert Telugu text to ascii text and to convert back that ascii text to Telugu. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 AUTHOR |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Rajkumar Reddy, mesg.raj@outlook.com |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Copyright (C) 2019 by Rajkumar Reddy |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
68
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.26.1 or, |
69
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |