line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Telugu::Utils; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
58184
|
use Mouse; |
|
1
|
|
|
|
|
23196
|
|
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
738
|
use Kavorka -all; |
|
1
|
|
|
|
|
11896
|
|
|
1
|
|
|
|
|
6
|
|
5
|
1
|
|
|
1
|
|
270449
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
6
|
1
|
|
|
1
|
|
1144
|
use Telugu::TGC; |
|
1
|
|
|
|
|
72948
|
|
|
1
|
|
|
|
|
94
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has 'tgc' => ( |
12
|
|
|
|
|
|
|
is => 'ro', |
13
|
|
|
|
|
|
|
isa => 'Object', |
14
|
|
|
|
|
|
|
default => sub { |
15
|
|
|
|
|
|
|
my $tgc = Telugu::TGC->new(); |
16
|
|
|
|
|
|
|
return $tgc; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
1
|
50
|
|
1
|
|
2368
|
method ngram( Str $string, Int $n ) { |
|
1
|
50
|
|
1
|
|
1
|
|
|
1
|
50
|
|
|
|
292
|
|
|
1
|
50
|
|
|
|
7
|
|
|
1
|
50
|
|
|
|
4
|
|
|
1
|
50
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
30
|
|
|
1
|
|
|
|
|
45
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
18
|
|
|
1
|
|
|
|
|
6
|
|
22
|
1
|
|
|
|
|
6
|
my @filtered = $self->tgc->TGC($string); |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
21035
|
my @ngram; |
25
|
1
|
|
|
|
|
6
|
foreach my $start ( 0 .. @filtered - $n ) { |
26
|
43
|
|
|
|
|
74
|
push @ngram, [ @filtered[ $start .. $start + $n - 1 ] ]; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
9
|
return @ngram; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |
36
|
|
|
|
|
|
|
=encoding utf-8 |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 NAME |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Telugu::Utils - Utilities for Telugu strings. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SYNOPSIS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
use Telugu::Utils; |
45
|
|
|
|
|
|
|
use utf8; |
46
|
|
|
|
|
|
|
binmode STDOUT, ":encoding(UTF-8)"; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $util = Telugu::Utils->new(); |
49
|
|
|
|
|
|
|
my @ngrams = $util->ngram("రాజ్కుమార్రెడ్డి", 2); |
50
|
|
|
|
|
|
|
print $ngrams[1][0], "\n"; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 DESCRIPTION |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Currently it provides one function, ngram. It takes two paramameters, first param must be a string and second param must be an integer. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 AUTHOR |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Rajkumar Reddy, mesg.raj@outlook.com |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Copyright (C) 2019 by Rajkumar Reddy |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
67
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.26.1 or, |
68
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |