line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::Lingua::EN::Fractions; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
206657
|
use strict; |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
304
|
|
4
|
6
|
|
|
6
|
|
32
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
284
|
|
5
|
|
|
|
|
|
|
|
6
|
6
|
|
|
6
|
|
32
|
use vars qw($VERSION); |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
600
|
|
7
|
|
|
|
|
|
|
$VERSION = 0.01; |
8
|
|
|
|
|
|
|
|
9
|
6
|
|
|
6
|
|
32
|
use base qw(Template::Plugin); |
|
6
|
|
|
|
|
22
|
|
|
6
|
|
|
|
|
7829
|
|
10
|
6
|
|
|
6
|
|
36588
|
use Template::Plugin; |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
146
|
|
11
|
6
|
|
|
6
|
|
7008
|
use Template::Stash; |
|
6
|
|
|
|
|
113677
|
|
|
6
|
|
|
|
|
676
|
|
12
|
6
|
|
|
6
|
|
6615
|
use Lingua::EN::Fractions qw( fraction2words ); |
|
6
|
|
|
|
|
39832
|
|
|
6
|
|
|
|
|
2049
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
$Template::Stash::SCALAR_OPS->{'fraction2words'} = \&_fraction2words; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub new { |
17
|
2
|
|
|
2
|
1
|
12650
|
my ($class, $context, $options) = @_; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# now define the filter and return the plugin |
20
|
2
|
|
|
|
|
15
|
$context->define_filter('fraction2words', \&_fraction2words); |
21
|
2
|
|
|
|
|
140
|
return bless {}, $class; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _fraction2words { |
25
|
4
|
50
|
|
4
|
|
292
|
my $options = ref $_[-1] eq 'HASH' ? pop : {}; |
26
|
4
|
|
|
|
|
17
|
return fraction2words(join('', @_)); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |