line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Telugu::TGC; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
69903
|
use Mouse; |
|
1
|
|
|
|
|
28637
|
|
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
1735
|
use Regexp::Grammars; |
|
1
|
|
|
|
|
25630
|
|
|
1
|
|
|
|
|
8
|
|
5
|
1
|
|
|
1
|
|
649
|
use Kavorka -all; |
|
1
|
|
|
|
|
14660
|
|
|
1
|
|
|
|
|
9
|
|
6
|
1
|
|
|
1
|
|
312964
|
use utf8; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.08'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# V[m] | CH | {CH}C[v][m] | D | F | Hpv | W | Sid | N | Other | NT |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# [] - 0 or 1 times |
13
|
|
|
|
|
|
|
# {} - zero or more times |
14
|
|
|
|
|
|
|
# | - a rule separator |
15
|
|
|
|
|
|
|
# V - independent vowel |
16
|
|
|
|
|
|
|
# m - modifier(Anusvara/Visarga/Chandrabindu) |
17
|
|
|
|
|
|
|
# C - consonant |
18
|
|
|
|
|
|
|
# v - dependent vowel |
19
|
|
|
|
|
|
|
# H - virama |
20
|
|
|
|
|
|
|
# D - digit |
21
|
|
|
|
|
|
|
# F - fraction |
22
|
|
|
|
|
|
|
# W - weights |
23
|
|
|
|
|
|
|
# Sid - siddham |
24
|
|
|
|
|
|
|
# N - never occurs, if script is written properly it never matches |
25
|
|
|
|
|
|
|
# CH - matches only when virama is at the end of the word |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# [m] is written as m_ |
28
|
|
|
|
|
|
|
# [v] is written as v_ |
29
|
|
|
|
|
|
|
# {CH} is written as CH__ |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my @result = (); |
32
|
|
|
|
|
|
|
|
33
|
1
|
50
|
|
1
|
|
1768
|
method TE::String::X() { |
|
1
|
50
|
|
1
|
|
3
|
|
|
1
|
|
|
|
|
164
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
3
|
|
34
|
1
|
|
|
|
|
2
|
for my $element ( @{ $self->{Tgc} } ) { |
|
1
|
|
|
|
|
4
|
|
35
|
47
|
|
|
|
|
72
|
$element->X(); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
1
|
50
|
|
1
|
|
1166
|
method TE::Tgc::X() { |
|
1
|
50
|
|
47
|
|
9
|
|
|
1
|
|
|
|
|
147
|
|
|
47
|
|
|
|
|
69
|
|
|
47
|
|
|
|
|
82
|
|
|
47
|
|
|
|
|
53
|
|
40
|
|
|
|
|
|
|
( $self->{S} |
41
|
|
|
|
|
|
|
|| $self->{Vm} |
42
|
|
|
|
|
|
|
|| $self->{CH} |
43
|
|
|
|
|
|
|
|| $self->{CHCvm} |
44
|
|
|
|
|
|
|
|| $self->{D} |
45
|
|
|
|
|
|
|
|| $self->{F} |
46
|
|
|
|
|
|
|
|| $self->{W} |
47
|
|
|
|
|
|
|
|| $self->{Sid} |
48
|
|
|
|
|
|
|
|| $self->{N} |
49
|
|
|
|
|
|
|
|| $self->{Other} |
50
|
47
|
|
33
|
|
|
354
|
|| $self->{NT} )->X(); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
1
|
50
|
|
1
|
|
1167
|
method TE::S::X() { |
|
1
|
50
|
|
11
|
|
2
|
|
|
1
|
|
|
|
|
107
|
|
|
11
|
|
|
|
|
18
|
|
|
11
|
|
|
|
|
18
|
|
|
11
|
|
|
|
|
13
|
|
54
|
11
|
|
|
|
|
25
|
push @result, $self->{''}; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
1
|
50
|
|
1
|
|
1168
|
method TE::Vm::X() { |
|
1
|
50
|
|
2
|
|
2
|
|
|
1
|
|
|
|
|
135
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
3
|
|
58
|
2
|
|
|
|
|
7
|
push @result, $self->{V}{''} . $self->{m_}{''}; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
1
|
50
|
|
1
|
|
1153
|
method TE::CH::X() { |
|
1
|
50
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
108
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
62
|
1
|
|
|
|
|
4
|
push @result, $self->{''}; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
1
|
50
|
|
1
|
|
1093
|
method TE::CHCvm::X() { |
|
1
|
50
|
|
7
|
|
3
|
|
|
1
|
|
|
|
|
138
|
|
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
9
|
|
66
|
|
|
|
|
|
|
push @result, |
67
|
7
|
|
|
|
|
26
|
$self->{CH__}{''} . $self->{C}{''} . $self->{v_}{''} . $self->{m_}{''}; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
1
|
0
|
|
1
|
|
1096
|
method TE::D::X() { |
|
1
|
0
|
|
0
|
|
2
|
|
|
1
|
|
|
|
|
106
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
71
|
0
|
|
|
|
|
0
|
push @result, $self->{''}; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
1
|
0
|
|
1
|
|
1116
|
method TE::F::X() { |
|
1
|
0
|
|
0
|
|
2
|
|
|
1
|
|
|
|
|
146
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
75
|
0
|
|
|
|
|
0
|
push @result, $self->{''}; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
1
|
50
|
|
1
|
|
1102
|
method TE::W::X() { |
|
1
|
50
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
113
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
79
|
1
|
|
|
|
|
4
|
push @result, $self->{''}; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
1
|
50
|
|
1
|
|
1108
|
method TE::Sid::X() { |
|
1
|
50
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
122
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
1
|
|
83
|
1
|
|
|
|
|
4
|
push @result, $self->{''}; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
1
|
50
|
|
1
|
|
1073
|
method TE::N::X() { |
|
1
|
50
|
|
1
|
|
4
|
|
|
1
|
|
|
|
|
165
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
87
|
1
|
|
|
|
|
4
|
push @result, $self->{''}; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
1
|
0
|
|
1
|
|
1118
|
method TE::Other::X() { |
|
1
|
0
|
|
0
|
|
1
|
|
|
1
|
|
|
|
|
107
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
91
|
0
|
|
|
|
|
0
|
push @result, $self->{''}; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
1
|
50
|
|
1
|
|
1129
|
method TE::NT::X() { |
|
1
|
50
|
|
23
|
|
2
|
|
|
1
|
|
|
|
|
161
|
|
|
23
|
|
|
|
|
39
|
|
|
23
|
|
|
|
|
38
|
|
|
23
|
|
|
|
|
25
|
|
95
|
23
|
|
|
|
|
47
|
push @result, $self->{''}; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
my $parser = qr { |
99
|
|
|
|
|
|
|
<nocontext:> |
100
|
|
|
|
|
|
|
<String> |
101
|
|
|
|
|
|
|
<objrule: TE::String> <[Tgc]>+ |
102
|
|
|
|
|
|
|
<objrule: TE::Tgc> <ws: (\s++)*> <S> | <Vm> | <CH> | <CHCvm> | <D> | <F> | <W> | <Sid> | <N> | <Other> | <NT> |
103
|
|
|
|
|
|
|
<objrule: TE::Vm> <V><m_> |
104
|
|
|
|
|
|
|
<objrule: TE::CHCvm> <CH__><C><v_><m_> |
105
|
|
|
|
|
|
|
<objtoken: TE::CH> ([à°-à°¹à±-à±])(à±\b) |
106
|
|
|
|
|
|
|
<objtoken: TE::V> [à°
-à°à± -ౡ] |
107
|
|
|
|
|
|
|
<objtoken: TE::m_> [à°-à°à°½à±à±]? |
108
|
|
|
|
|
|
|
<objtoken: TE::CH__> (([à°-à°¹à±-à±])(à±))* |
109
|
|
|
|
|
|
|
<objtoken: TE::C> [à°-à°¹à±-à±] |
110
|
|
|
|
|
|
|
<objtoken: TE::v_> [à°¾-à±à±¢à±£]? |
111
|
|
|
|
|
|
|
<objtoken: TE::D> [౦-౯] |
112
|
|
|
|
|
|
|
<objtoken: TE::F> [౸-౾] |
113
|
|
|
|
|
|
|
<objtoken: TE::W> [౿] |
114
|
|
|
|
|
|
|
<objtoken: TE::Sid> [à±·] |
115
|
|
|
|
|
|
|
<objtoken: TE::N> [à°¾-à±à±¢à±£à°-à°à°½à±à±] |
116
|
|
|
|
|
|
|
<objtoken: TE::S> [ ] |
117
|
|
|
|
|
|
|
<objtoken: TE::Other> [à°-౿] |
118
|
|
|
|
|
|
|
<objtoken: TE::NT> [^à°-౿] |
119
|
|
|
|
|
|
|
}xms; |
120
|
|
|
|
|
|
|
|
121
|
1
|
50
|
|
1
|
|
18313
|
method TGC( Str $string ) { |
|
1
|
50
|
|
1
|
|
3
|
|
|
1
|
50
|
|
|
|
253
|
|
|
1
|
50
|
|
|
|
246
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
18
|
|
|
1
|
|
|
|
|
43
|
|
122
|
1
|
50
|
|
|
|
47
|
if ( $string =~ $parser ) { |
123
|
1
|
|
|
|
|
9
|
$/{String}->X(); |
124
|
|
|
|
|
|
|
} |
125
|
1
|
|
|
|
|
19
|
return @result; |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
1; |
129
|
|
|
|
|
|
|
__END__ |
130
|
|
|
|
|
|
|
=encoding utf-8 |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 NAME |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Telugu::TGC - Tailored grapheme clusters for Telugu languauge. |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head1 SYNOPSIS |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
use Telugu::TGC; |
139
|
|
|
|
|
|
|
use utf8; |
140
|
|
|
|
|
|
|
binmode STDOUT, ":encoding(UTF-8)"; |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
my $tgc = Telugu::TGC->new(); |
143
|
|
|
|
|
|
|
my @result = $tgc->TGC("à°°à°¾à°à±à°à±à°®à°¾à°°à±à°°à±à°¡à±à°¡à°¿"); |
144
|
|
|
|
|
|
|
print $result[1], "\n"; |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=head1 DESCRIPTION |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
This module provides one function, TGC. |
150
|
|
|
|
|
|
|
This function takes a string and returns an array. |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=head1 BUGS |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
Please send me email, if you find any bugs |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=head1 AUTHOR |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
Rajkumar Reddy, mesg.raj@outlook.com |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
Copyright (C) 2019 by Rajkumar Reddy |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
167
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.26.1 or, |
168
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=cut |