line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Lingua::IN::TGC; |
3
|
|
|
|
|
|
|
|
4
|
5
|
|
|
5
|
|
298466
|
use Mouse; |
|
5
|
|
|
|
|
117060
|
|
|
5
|
|
|
|
|
23
|
|
5
|
5
|
|
|
5
|
|
7237
|
use Regexp::Grammars; |
|
5
|
|
|
|
|
107676
|
|
|
5
|
|
|
|
|
37
|
|
6
|
5
|
|
|
5
|
|
2792
|
use Kavorka -all; |
|
5
|
|
|
|
|
58124
|
|
|
5
|
|
|
|
|
42
|
|
7
|
5
|
|
|
5
|
|
1294803
|
use utf8; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
40
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '2.04'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my @result = (); |
12
|
|
|
|
|
|
|
|
13
|
5
|
50
|
|
5
|
|
6869
|
method IN::String::X() { |
|
5
|
50
|
|
5
|
|
11
|
|
|
5
|
|
|
|
|
712
|
|
|
5
|
|
|
|
|
22
|
|
|
5
|
|
|
|
|
18
|
|
|
5
|
|
|
|
|
7
|
|
14
|
5
|
|
|
|
|
10
|
for my $element ( @{ $self->{Tgc} } ) { |
|
5
|
|
|
|
|
19
|
|
15
|
58
|
|
|
|
|
96
|
$element->X(); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
5
|
50
|
|
5
|
|
4574
|
method IN::Tgc::X() { |
|
5
|
50
|
|
58
|
|
9
|
|
|
5
|
|
|
|
|
589
|
|
|
58
|
|
|
|
|
86
|
|
|
58
|
|
|
|
|
101
|
|
|
58
|
|
|
|
|
55
|
|
20
|
|
|
|
|
|
|
( $self->{S} |
21
|
|
|
|
|
|
|
|| $self->{Vm} |
22
|
|
|
|
|
|
|
|| $self->{CH} |
23
|
|
|
|
|
|
|
|| $self->{CHCvm} |
24
|
|
|
|
|
|
|
|| $self->{N} |
25
|
|
|
|
|
|
|
|| $self->{Other} |
26
|
58
|
|
66
|
|
|
321
|
|| $self->{NT} )->X(); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
5
|
50
|
|
5
|
|
4559
|
method IN::S::X() { |
|
5
|
50
|
|
6
|
|
10
|
|
|
5
|
|
|
|
|
477
|
|
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
5
|
|
30
|
6
|
|
|
|
|
14
|
push @result, $self->{''}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
5
|
50
|
|
5
|
|
4532
|
method IN::Vm::X() { |
|
5
|
50
|
|
3
|
|
10
|
|
|
5
|
|
|
|
|
559
|
|
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
4
|
|
34
|
3
|
|
|
|
|
13
|
push @result, $self->{V}{''} . $self->{m_}{''}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
5
|
50
|
|
5
|
|
4651
|
method IN::CH::X() { |
|
5
|
50
|
|
1
|
|
11
|
|
|
5
|
|
|
|
|
451
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
38
|
1
|
|
|
|
|
5
|
push @result, $self->{''}; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
5
|
50
|
|
5
|
|
4635
|
method IN::CHCvm::X() { |
|
5
|
50
|
|
22
|
|
9
|
|
|
5
|
|
|
|
|
583
|
|
|
22
|
|
|
|
|
41
|
|
|
22
|
|
|
|
|
45
|
|
|
22
|
|
|
|
|
24
|
|
42
|
|
|
|
|
|
|
push @result, |
43
|
22
|
|
|
|
|
73
|
$self->{CH__}{''} . $self->{C}{''} . $self->{v_}{''} . $self->{m_}{''}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
5
|
50
|
|
5
|
|
4536
|
method IN::N::X() { |
|
5
|
50
|
|
1
|
|
7
|
|
|
5
|
|
|
|
|
447
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
47
|
1
|
|
|
|
|
3
|
push @result, $self->{''}; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
5
|
50
|
|
5
|
|
4621
|
method IN::Other::X() { |
|
5
|
50
|
|
2
|
|
10
|
|
|
5
|
|
|
|
|
523
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
4
|
|
51
|
2
|
|
|
|
|
5
|
push @result, $self->{''}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
5
|
50
|
|
5
|
|
4692
|
method IN::NT::X() { |
|
5
|
50
|
|
23
|
|
10
|
|
|
5
|
|
|
|
|
646
|
|
|
23
|
|
|
|
|
31
|
|
|
23
|
|
|
|
|
32
|
|
|
23
|
|
|
|
|
20
|
|
55
|
23
|
|
|
|
|
44
|
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
|
|
|
|
|
|
|
qr { |
149
|
|
|
|
|
|
|
<grammar: Lingua::IN::TGC::OR> |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
<objrule: IN::Tgc> <ws: (\s++)*> <S> | <Vm> | <CH> | <CHCvm> | <N> | <Other> | <NT> |
152
|
|
|
|
|
|
|
<objrule: IN::Vm> <V><m_> |
153
|
|
|
|
|
|
|
<objrule: IN::CHCvm> <CH__><C><v_><m_> |
154
|
|
|
|
|
|
|
<objtoken: IN::CH> ([à¬-ହà-à])(à\b) |
155
|
|
|
|
|
|
|
<objtoken: IN::V> [à¬
-à¬à à¡] |
156
|
|
|
|
|
|
|
<objtoken: IN::m_> [à¬-à¬à¬¼à¬½àà]? |
157
|
|
|
|
|
|
|
<objtoken: IN::CH__> (([à¬-ହà-à])(à))* |
158
|
|
|
|
|
|
|
<objtoken: IN::C> [à¬-ହà-à] |
159
|
|
|
|
|
|
|
<objtoken: IN::v_> [ା-àààà¢à£]? |
160
|
|
|
|
|
|
|
<objtoken: IN::N> [ା-àààà¢à£à¬-à¬à¬¼à¬½àà] |
161
|
|
|
|
|
|
|
<objtoken: IN::S> [ ] |
162
|
|
|
|
|
|
|
<objtoken: IN::Other> [à¬-à·] |
163
|
|
|
|
|
|
|
<objtoken: IN::NT> [^à¬-à·] |
164
|
|
|
|
|
|
|
}xms; |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
qr { |
167
|
|
|
|
|
|
|
<grammar: Lingua::IN::TGC::GU> |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
<objrule: IN::Tgc> <ws: (\s++)*> <S> | <Vm> | <CH> | <CHCvm> | <N> | <Other> | <NT> |
170
|
|
|
|
|
|
|
<objrule: IN::Vm> <V><m_> |
171
|
|
|
|
|
|
|
<objrule: IN::CHCvm> <CH__><C><v_><m_> |
172
|
|
|
|
|
|
|
<objtoken: IN::CH> ([à°-à°¹à±-à±])(à±\b) |
173
|
|
|
|
|
|
|
<objtoken: IN::V> [à°
-à°à± -ౡ] |
174
|
|
|
|
|
|
|
<objtoken: IN::m_> [à°-à°à°½à±à±]? |
175
|
|
|
|
|
|
|
<objtoken: IN::CH__> (([à°-à°¹à±-à±])(à±))* |
176
|
|
|
|
|
|
|
<objtoken: IN::C> [à°-à°¹à±-à±] |
177
|
|
|
|
|
|
|
<objtoken: IN::v_> [à°¾-à±à±¢à±£]? |
178
|
|
|
|
|
|
|
<objtoken: IN::N> [à°¾-à±à±¢à±£à°-à°à°½à±à±] |
179
|
|
|
|
|
|
|
<objtoken: IN::S> [ ] |
180
|
|
|
|
|
|
|
<objtoken: IN::Other> [à°-౿] |
181
|
|
|
|
|
|
|
<objtoken: IN::NT> [^à°-౿] |
182
|
|
|
|
|
|
|
}xms; |
183
|
|
|
|
|
|
|
|
184
|
5
|
50
|
|
5
|
|
80591
|
method TGC( Str $lang, Str $string ) { |
|
5
|
50
|
|
5
|
|
13
|
|
|
5
|
50
|
|
|
|
987
|
|
|
5
|
50
|
|
|
|
901
|
|
|
5
|
50
|
|
|
|
38
|
|
|
5
|
50
|
|
|
|
20
|
|
|
5
|
|
|
|
|
17
|
|
|
5
|
|
|
|
|
96
|
|
|
5
|
|
|
|
|
226
|
|
|
5
|
|
|
|
|
21
|
|
|
5
|
|
|
|
|
21
|
|
|
5
|
|
|
|
|
25
|
|
185
|
5
|
|
|
|
|
16
|
my $lang_code = "Lingua::IN::TGC::" . $lang; |
186
|
5
|
|
|
|
|
161
|
my $parser = qr { |
187
|
|
|
|
|
|
|
<extends: $lang_code> |
188
|
|
|
|
|
|
|
<nocontext:> |
189
|
|
|
|
|
|
|
<String> |
190
|
|
|
|
|
|
|
<objrule: IN::String> <[Tgc]>+ |
191
|
|
|
|
|
|
|
}xms; |
192
|
|
|
|
|
|
|
|
193
|
5
|
50
|
|
|
|
242
|
if ( $string =~ $parser ) { |
194
|
5
|
|
|
|
|
31
|
$/{String}->X(); |
195
|
|
|
|
|
|
|
} |
196
|
5
|
|
|
|
|
69
|
return @result; |
197
|
|
|
|
|
|
|
} |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
1; |
200
|
|
|
|
|
|
|
__END__ |
201
|
|
|
|
|
|
|
=encoding utf-8 |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=head1 NAME |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
Lingua::IN::TGC - Tailored grapheme clusters for Indic scripts. |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
=head1 SYNOPSIS |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
use Lingua::IN::TGC; |
210
|
|
|
|
|
|
|
use utf8; |
211
|
|
|
|
|
|
|
binmode STDOUT, ":encoding(UTF-8)"; |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
my $tgc = Lingua::IN::TGC->new(); |
214
|
|
|
|
|
|
|
my @result = $tgc->TGC("TE", "à°°à°¾à°à±à°à±à°®à°¾à°°à±à°°à±à°¡à±à°¡à°¿"); |
215
|
|
|
|
|
|
|
print $result[1], "\n"; |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=head1 DESCRIPTION |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
This module provides one function, TGC. |
221
|
|
|
|
|
|
|
This function takes two arguments, a language code and a string. |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
=head1 LANGUAGE CODES |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
TE - Telugu |
227
|
|
|
|
|
|
|
DE - Devanagari |
228
|
|
|
|
|
|
|
TA - Tamil |
229
|
|
|
|
|
|
|
KN - Kannada |
230
|
|
|
|
|
|
|
OR - Oriya |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
=head1 TODO |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
Add support for bengali, malayalam, gujarati, punjabi |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
=head1 API CHANGE |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
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. |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
=head1 BUGS |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
Please send me email, if you find any bugs |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
=head1 AUTHOR |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
Rajkumar Reddy, mesg.raj@outlook.com |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
Copyright (C) 2019 by Rajkumar Reddy |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
257
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.26.1 or, |
258
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
=cut |