line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Telugu::Utils; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
69692
|
use Mouse; |
|
1
|
|
|
|
|
28479
|
|
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
915
|
use Kavorka -all; |
|
1
|
|
|
|
|
14345
|
|
|
1
|
|
|
|
|
9
|
|
5
|
1
|
|
|
1
|
|
326364
|
use utf8; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
6
|
1
|
|
|
1
|
|
532
|
use Telugu::TGC; |
|
1
|
|
|
|
|
89089
|
|
|
1
|
|
|
|
|
147
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
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
|
|
2989
|
method ngram( Str $string, Int $n ) { |
|
1
|
50
|
|
1
|
|
2
|
|
|
1
|
50
|
|
|
|
350
|
|
|
1
|
50
|
|
|
|
10
|
|
|
1
|
50
|
|
|
|
5
|
|
|
1
|
50
|
|
|
|
5
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
17
|
|
|
1
|
|
|
|
|
53
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
10
|
|
22
|
1
|
|
|
|
|
10
|
my @filtered = $self->tgc->TGC($string); |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
|
|
26607
|
my @ngram; |
25
|
1
|
|
|
|
|
6
|
foreach my $start ( 0 .. @filtered - $n ) { |
26
|
43
|
|
|
|
|
90
|
push @ngram, [ @filtered[ $start .. $start + $n - 1 ] ]; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
8
|
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 |