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