line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Lingua::IN::TGC; |
3
|
|
|
|
|
|
|
|
4
|
5
|
|
|
5
|
|
366002
|
use Mouse; |
|
5
|
|
|
|
|
149144
|
|
|
5
|
|
|
|
|
26
|
|
5
|
5
|
|
|
5
|
|
9065
|
use Regexp::Grammars; |
|
5
|
|
|
|
|
136161
|
|
|
5
|
|
|
|
|
44
|
|
6
|
5
|
|
|
5
|
|
3759
|
use Kavorka; |
|
5
|
|
|
|
|
76223
|
|
|
5
|
|
|
|
|
48
|
|
7
|
5
|
|
|
5
|
|
906826
|
use utf8; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
43
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '2.06'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my @result = (); |
12
|
|
|
|
|
|
|
|
13
|
5
|
50
|
|
5
|
|
7841
|
method IN::String::X() { |
|
5
|
50
|
|
5
|
|
11
|
|
|
5
|
|
|
|
|
893
|
|
|
5
|
|
|
|
|
25
|
|
|
5
|
|
|
|
|
23
|
|
|
5
|
|
|
|
|
11
|
|
14
|
5
|
|
|
|
|
11
|
for my $element ( @{ $self->{Tgc} } ) { |
|
5
|
|
|
|
|
24
|
|
15
|
58
|
|
|
|
|
104
|
$element->X(); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
5
|
50
|
|
5
|
|
6051
|
method IN::Tgc::X() { |
|
5
|
50
|
|
58
|
|
13
|
|
|
5
|
|
|
|
|
770
|
|
|
58
|
|
|
|
|
106
|
|
|
58
|
|
|
|
|
134
|
|
|
58
|
|
|
|
|
75
|
|
20
|
|
|
|
|
|
|
( $self->{S} |
21
|
|
|
|
|
|
|
|| $self->{Vm} |
22
|
|
|
|
|
|
|
|| $self->{CH} |
23
|
|
|
|
|
|
|
|| $self->{CHCvm} |
24
|
|
|
|
|
|
|
|| $self->{N} |
25
|
|
|
|
|
|
|
|| $self->{Other} |
26
|
58
|
|
66
|
|
|
417
|
|| $self->{NT} )->X(); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
5
|
50
|
|
5
|
|
5792
|
method IN::S::X() { |
|
5
|
50
|
|
6
|
|
13
|
|
|
5
|
|
|
|
|
599
|
|
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
7
|
|
30
|
6
|
|
|
|
|
12
|
push @result, $self->{''}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
5
|
50
|
|
5
|
|
5954
|
method IN::Vm::X() { |
|
5
|
50
|
|
3
|
|
12
|
|
|
5
|
|
|
|
|
700
|
|
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
6
|
|
34
|
3
|
|
|
|
|
15
|
push @result, $self->{V}{''} . $self->{m_}{''}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
5
|
50
|
|
5
|
|
5780
|
method IN::CH::X() { |
|
5
|
50
|
|
1
|
|
13
|
|
|
5
|
|
|
|
|
636
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
38
|
1
|
|
|
|
|
4
|
push @result, $self->{''}; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
5
|
50
|
|
5
|
|
5743
|
method IN::CHCvm::X() { |
|
5
|
50
|
|
22
|
|
12
|
|
|
5
|
|
|
|
|
746
|
|
|
22
|
|
|
|
|
55
|
|
|
22
|
|
|
|
|
45
|
|
|
22
|
|
|
|
|
31
|
|
42
|
|
|
|
|
|
|
push @result, |
43
|
22
|
|
|
|
|
88
|
$self->{CH__}{''} . $self->{C}{''} . $self->{v_}{''} . $self->{m_}{''}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
5
|
50
|
|
5
|
|
5937
|
method IN::N::X() { |
|
5
|
50
|
|
1
|
|
11
|
|
|
5
|
|
|
|
|
809
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
47
|
1
|
|
|
|
|
4
|
push @result, $self->{''}; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
5
|
50
|
|
5
|
|
5843
|
method IN::Other::X() { |
|
5
|
50
|
|
2
|
|
13
|
|
|
5
|
|
|
|
|
573
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
3
|
|
51
|
2
|
|
|
|
|
6
|
push @result, $self->{''}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
5
|
50
|
|
5
|
|
5494
|
method IN::NT::X() { |
|
5
|
50
|
|
23
|
|
12
|
|
|
5
|
|
|
|
|
784
|
|
|
23
|
|
|
|
|
35
|
|
|
23
|
|
|
|
|
76
|
|
|
23
|
|
|
|
|
27
|
|
55
|
23
|
|
|
|
|
49
|
push @result, $self->{''}; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
qr { |
59
|
|
|
|
|
|
|
<grammar: Lingua::IN::TGC::TE> |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
<objrule: IN::Tgc> <ws: (\s++)*> <S> | <Vm> | <CH> | <CHCvm> | <N> | <Other> | <NT> |
62
|
|
|
|
|
|
|
<objrule: IN::Vm> <V><m_> |
63
|
|
|
|
|
|
|
<objrule: IN::CHCvm> <CH__><C><v_><m_> |
64
|
|
|
|
|
|
|
<objtoken: IN::CH> ([క-హౘ-ౚ])(్\b) |
65
|
|
|
|
|
|
|
<objtoken: IN::V> [అ-ఔౠ-ౡ] |
66
|
|
|
|
|
|
|
<objtoken: IN::m_> [ఀ-ఄఽౕౖ]? |
67
|
|
|
|
|
|
|
<objtoken: IN::CH__> (([క-హౘ-ౚ])(్))* |
68
|
|
|
|
|
|
|
<objtoken: IN::C> [క-హౘ-ౚ] |
69
|
|
|
|
|
|
|
<objtoken: IN::v_> [ా-ౌౢౣ]? |
70
|
|
|
|
|
|
|
<objtoken: IN::N> [ా-ౌౢౣఀ-ఄఽౕౖ] |
71
|
|
|
|
|
|
|
<objtoken: IN::S> [ ] |
72
|
|
|
|
|
|
|
<objtoken: IN::Other> [ఀ-౿] |
73
|
|
|
|
|
|
|
<objtoken: IN::NT> [^ఀ-౿] |
74
|
|
|
|
|
|
|
}xms; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
qr { |
77
|
|
|
|
|
|
|
<grammar: Lingua::IN::TGC::DE> |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
<objrule: IN::Tgc> <ws: (\s++)*> <S> | <Vm> | <CH> | <CHCvm> | <N> | <Other> | <NT> |
80
|
|
|
|
|
|
|
<objrule: IN::Vm> <V><m_> |
81
|
|
|
|
|
|
|
<objrule: IN::CHCvm> <CH__><C><v_><m_> |
82
|
|
|
|
|
|
|
<objtoken: IN::CH> ([क-ह])(्\b) |
83
|
|
|
|
|
|
|
<objtoken: IN::V> [ऄ-औॲ-ॷ] |
84
|
|
|
|
|
|
|
<objtoken: IN::m_> [ऀ-ःऽ़]? |
85
|
|
|
|
|
|
|
<objtoken: IN::CH__> (([क-ह])(्))* |
86
|
|
|
|
|
|
|
<objtoken: IN::C> [क-ह] |
87
|
|
|
|
|
|
|
<objtoken: IN::v_> [ा-ौॎॏॕॖॗ]? |
88
|
|
|
|
|
|
|
<objtoken: IN::N> [ा-ौॎॏॕॖॗऀ-ःऽ़] |
89
|
|
|
|
|
|
|
<objtoken: IN::S> [ ] |
90
|
|
|
|
|
|
|
<objtoken: IN::Other> [ऀ-ॿ] |
91
|
|
|
|
|
|
|
<objtoken: IN::NT> [^ऀ-ॿ] |
92
|
|
|
|
|
|
|
}xms; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
qr { |
95
|
|
|
|
|
|
|
<grammar: Lingua::IN::TGC::TA> |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
<objrule: IN::Tgc> <ws: (\s++)*> <S> | <Vm> | <CH> | <CHCvm> | <N> | <Other> | <NT> |
98
|
|
|
|
|
|
|
<objrule: IN::Vm> <V><m_> |
99
|
|
|
|
|
|
|
<objrule: IN::CHCvm> <CH__><C><v_><m_> |
100
|
|
|
|
|
|
|
<objtoken: IN::CH> ([க-ஹ])(்\b) |
101
|
|
|
|
|
|
|
<objtoken: IN::V> [அ-ஔ] |
102
|
|
|
|
|
|
|
<objtoken: IN::m_> [ஂ-ஃௗ]? |
103
|
|
|
|
|
|
|
<objtoken: IN::CH__> (([க-ஹ])(்))* |
104
|
|
|
|
|
|
|
<objtoken: IN::C> [க-ஹ] |
105
|
|
|
|
|
|
|
<objtoken: IN::v_> [ா-ை]? |
106
|
|
|
|
|
|
|
<objtoken: IN::N> [ா-ைஂ-ஃௗ] |
107
|
|
|
|
|
|
|
<objtoken: IN::S> [ ] |
108
|
|
|
|
|
|
|
<objtoken: IN::Other> [ஂ-௺] |
109
|
|
|
|
|
|
|
<objtoken: IN::NT> [^ஂ-௺] |
110
|
|
|
|
|
|
|
}xms; |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
qr { |
113
|
|
|
|
|
|
|
<grammar: Lingua::IN::TGC::KN> |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
<objrule: IN::Tgc> <ws: (\s++)*> <S> | <Vm> | <CH> | <CHCvm> | <N> | <Other> | <NT> |
116
|
|
|
|
|
|
|
<objrule: IN::Vm> <V><m_> |
117
|
|
|
|
|
|
|
<objrule: IN::CHCvm> <CH__><C><v_><m_> |
118
|
|
|
|
|
|
|
<objtoken: IN::CH> ([ಕ-ಹೞ])(್\b) |
119
|
|
|
|
|
|
|
<objtoken: IN::V> [ಅ-ಔೠ-ೡ] |
120
|
|
|
|
|
|
|
<objtoken: IN::m_> [ಀ-಄಼ಽೕೖ]? |
121
|
|
|
|
|
|
|
<objtoken: IN::CH__> (([ಕ-ಹೞ])(್))* |
122
|
|
|
|
|
|
|
<objtoken: IN::C> [ಕ-ಹೞ] |
123
|
|
|
|
|
|
|
<objtoken: IN::v_> [ಾ-ೌೢೣ]? |
124
|
|
|
|
|
|
|
<objtoken: IN::N> [ಾ-ೌೢೣఽಀ-಄಼ಽೕೖ] |
125
|
|
|
|
|
|
|
<objtoken: IN::S> [ ] |
126
|
|
|
|
|
|
|
<objtoken: IN::Other> [ಀ-ೲ] |
127
|
|
|
|
|
|
|
<objtoken: IN::NT> [^ಀ-ೲ] |
128
|
|
|
|
|
|
|
}xms; |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
qr { |
131
|
|
|
|
|
|
|
<grammar: Lingua::IN::TGC::OR> |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
<objrule: IN::Tgc> <ws: (\s++)*> <S> | <Vm> | <CH> | <CHCvm> | <N> | <Other> | <NT> |
134
|
|
|
|
|
|
|
<objrule: IN::Vm> <V><m_> |
135
|
|
|
|
|
|
|
<objrule: IN::CHCvm> <CH__><C><v_><m_> |
136
|
|
|
|
|
|
|
<objtoken: IN::CH> ([କ-ହଡ଼-ୟ])(୍\b) |
137
|
|
|
|
|
|
|
<objtoken: IN::V> [ଅ-ଔୠୡ] |
138
|
|
|
|
|
|
|
<objtoken: IN::m_> [ଁ-ଃ଼ଽୖୗ]? |
139
|
|
|
|
|
|
|
<objtoken: IN::CH__> (([କ-ହଡ଼-ୟ])(୍))* |
140
|
|
|
|
|
|
|
<objtoken: IN::C> [କ-ହଡ଼-ୟ] |
141
|
|
|
|
|
|
|
<objtoken: IN::v_> [ା-ୈୋୌୢୣ]? |
142
|
|
|
|
|
|
|
<objtoken: IN::N> [ା-ୈୋୌୢୣଁ-ଃ଼ଽୖୗ] |
143
|
|
|
|
|
|
|
<objtoken: IN::S> [ ] |
144
|
|
|
|
|
|
|
<objtoken: IN::Other> [ଁ-୷] |
145
|
|
|
|
|
|
|
<objtoken: IN::NT> [^ଁ-୷] |
146
|
|
|
|
|
|
|
}xms; |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
|
150
|
5
|
50
|
|
5
|
|
559773
|
method TGC( Str $lang, Str $string ) { |
|
5
|
50
|
|
5
|
|
15
|
|
|
5
|
50
|
|
|
|
1559
|
|
|
5
|
50
|
|
|
|
998
|
|
|
5
|
50
|
|
|
|
44
|
|
|
5
|
50
|
|
|
|
27
|
|
|
5
|
|
|
|
|
20
|
|
|
5
|
|
|
|
|
149
|
|
|
5
|
|
|
|
|
271
|
|
|
5
|
|
|
|
|
26
|
|
|
5
|
|
|
|
|
26
|
|
|
5
|
|
|
|
|
31
|
|
151
|
5
|
|
|
|
|
20
|
my $lang_code = "Lingua::IN::TGC::" . $lang; |
152
|
5
|
|
|
|
|
159
|
my $parser = qr { |
153
|
|
|
|
|
|
|
<extends: $lang_code> |
154
|
|
|
|
|
|
|
<nocontext:> |
155
|
|
|
|
|
|
|
<String> |
156
|
|
|
|
|
|
|
<objrule: IN::String> <[Tgc]>+ |
157
|
|
|
|
|
|
|
}xms; |
158
|
|
|
|
|
|
|
|
159
|
5
|
50
|
|
|
|
277
|
if ( $string =~ $parser ) { |
160
|
5
|
|
|
|
|
41
|
$/{String}->X(); |
161
|
|
|
|
|
|
|
} |
162
|
5
|
|
|
|
|
90
|
return @result; |
163
|
|
|
|
|
|
|
} |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
1; |
166
|
|
|
|
|
|
|
__END__ |
167
|
|
|
|
|
|
|
=encoding utf-8 |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=head1 NAME |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
Lingua::IN::TGC - Tailored grapheme clusters for Indic scripts. |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=head1 SYNOPSIS |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
use Lingua::IN::TGC; |
176
|
|
|
|
|
|
|
use utf8; |
177
|
|
|
|
|
|
|
binmode STDOUT, ":encoding(UTF-8)"; |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
my $tgc = Lingua::IN::TGC->new(); |
180
|
|
|
|
|
|
|
my @result = $tgc->TGC("TE", "రాజ్కుమార్రెడ్డి"); |
181
|
|
|
|
|
|
|
print $result[1], "\n"; |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=head1 DESCRIPTION |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
This module provides one function, TGC. |
187
|
|
|
|
|
|
|
This function takes two arguments, a language code and a string. |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=head1 LANGUAGE CODES |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
TE - Telugu |
193
|
|
|
|
|
|
|
DE - Devanagari |
194
|
|
|
|
|
|
|
TA - Tamil |
195
|
|
|
|
|
|
|
KN - Kannada |
196
|
|
|
|
|
|
|
OR - Oriya |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=head1 TODO |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
Add support for bengali, malayalam, gujarati, punjabi |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=head1 API CHANGE |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
This 2.xx version is reimplementation of 1.xx module. If you are using 1.xx version please know that newer version api is changed. |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=head1 BUGS |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
Please send me email, if you find any bugs |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
=head1 AUTHOR |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
Rajkumar Reddy, mesg.raj@outlook.com |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
Copyright (C) 2019 by Rajkumar Reddy |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
223
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.26.1 or, |
224
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
=cut |