line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Telugu::TGC; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
60704
|
use Mouse; |
|
1
|
|
|
|
|
27895
|
|
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
2276
|
use Regexp::Grammars; |
|
1
|
|
|
|
|
22184
|
|
|
1
|
|
|
|
|
8
|
|
5
|
1
|
|
|
1
|
|
1329
|
use Kavorka -all; |
|
1
|
|
|
|
|
22179
|
|
|
1
|
|
|
|
|
10
|
|
6
|
1
|
|
|
1
|
|
282283
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.09'; |
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
|
|
1323
|
method TE::String::X() { |
|
1
|
50
|
|
1
|
|
3
|
|
|
1
|
|
|
|
|
144
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
3
|
|
34
|
1
|
|
|
|
|
2
|
for my $element ( @{ $self->{Tgc} } ) { |
|
1
|
|
|
|
|
5
|
|
35
|
47
|
|
|
|
|
60
|
$element->X(); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
1
|
50
|
|
1
|
|
945
|
method TE::Tgc::X() { |
|
1
|
50
|
|
47
|
|
1
|
|
|
1
|
|
|
|
|
130
|
|
|
47
|
|
|
|
|
59
|
|
|
47
|
|
|
|
|
62
|
|
|
47
|
|
|
|
|
45
|
|
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
|
|
|
316
|
|| $self->{NT} )->X(); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
1
|
50
|
|
1
|
|
902
|
method TE::S::X() { |
|
1
|
50
|
|
11
|
|
2
|
|
|
1
|
|
|
|
|
93
|
|
|
11
|
|
|
|
|
17
|
|
|
11
|
|
|
|
|
17
|
|
|
11
|
|
|
|
|
11
|
|
54
|
11
|
|
|
|
|
50
|
push @result, $self->{''}; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
1
|
50
|
|
1
|
|
899
|
method TE::Vm::X() { |
|
1
|
50
|
|
2
|
|
3
|
|
|
1
|
|
|
|
|
120
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
3
|
|
58
|
2
|
|
|
|
|
7
|
push @result, $self->{V}{''} . $self->{m_}{''}; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
1
|
50
|
|
1
|
|
889
|
method TE::CH::X() { |
|
1
|
50
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
101
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
62
|
1
|
|
|
|
|
3
|
push @result, $self->{''}; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
1
|
50
|
|
1
|
|
933
|
method TE::CHCvm::X() { |
|
1
|
50
|
|
7
|
|
3
|
|
|
1
|
|
|
|
|
123
|
|
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
8
|
|
66
|
|
|
|
|
|
|
push @result, |
67
|
7
|
|
|
|
|
23
|
$self->{CH__}{''} . $self->{C}{''} . $self->{v_}{''} . $self->{m_}{''}; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
1
|
0
|
|
1
|
|
880
|
method TE::D::X() { |
|
1
|
0
|
|
0
|
|
2
|
|
|
1
|
|
|
|
|
93
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
71
|
0
|
|
|
|
|
0
|
push @result, $self->{''}; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
1
|
0
|
|
1
|
|
875
|
method TE::F::X() { |
|
1
|
0
|
|
0
|
|
2
|
|
|
1
|
|
|
|
|
91
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
75
|
0
|
|
|
|
|
0
|
push @result, $self->{''}; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
1
|
50
|
|
1
|
|
909
|
method TE::W::X() { |
|
1
|
50
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
91
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
79
|
1
|
|
|
|
|
4
|
push @result, $self->{''}; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
1
|
50
|
|
1
|
|
944
|
method TE::Sid::X() { |
|
1
|
50
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
100
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
1
|
|
83
|
1
|
|
|
|
|
4
|
push @result, $self->{''}; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
1
|
50
|
|
1
|
|
891
|
method TE::N::X() { |
|
1
|
50
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
93
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
1
|
|
87
|
1
|
|
|
|
|
4
|
push @result, $self->{''}; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
1
|
0
|
|
1
|
|
932
|
method TE::Other::X() { |
|
1
|
0
|
|
0
|
|
2
|
|
|
1
|
|
|
|
|
109
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
91
|
0
|
|
|
|
|
0
|
push @result, $self->{''}; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
1
|
50
|
|
1
|
|
910
|
method TE::NT::X() { |
|
1
|
50
|
|
23
|
|
1
|
|
|
1
|
|
|
|
|
129
|
|
|
23
|
|
|
|
|
31
|
|
|
23
|
|
|
|
|
34
|
|
|
23
|
|
|
|
|
20
|
|
95
|
23
|
|
|
|
|
32
|
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
|
|
16593
|
method TGC( Str $string ) { |
|
1
|
50
|
|
1
|
|
2
|
|
|
1
|
50
|
|
|
|
236
|
|
|
1
|
50
|
|
|
|
164
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
16
|
|
|
1
|
|
|
|
|
40
|
|
122
|
1
|
50
|
|
|
|
31
|
if ( $string =~ $parser ) { |
123
|
1
|
|
|
|
|
8
|
$/{String}->X(); |
124
|
|
|
|
|
|
|
} |
125
|
1
|
|
|
|
|
18
|
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 |