line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::JA::Fold; |
2
|
2
|
|
|
2
|
|
112355
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
87
|
|
3
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
62
|
|
4
|
2
|
|
|
2
|
|
965
|
use utf8; |
|
2
|
|
|
|
|
18
|
|
|
2
|
|
|
|
|
15
|
|
5
|
2
|
|
|
2
|
|
98
|
use 5.008001; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
92
|
|
6
|
2
|
|
|
2
|
|
11
|
use base qw(Template::Plugin); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
7468
|
|
7
|
2
|
|
|
2
|
|
43090
|
use Lingua::JA::Fold qw(fold); |
|
2
|
|
|
|
|
63191
|
|
|
2
|
|
|
|
|
582
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
4
|
|
|
4
|
1
|
9260
|
my ( $class, $context, @params ) = @_; |
13
|
4
|
|
|
|
|
15
|
$context->define_filter( 'fold' => $class->_filter_factory() ); |
14
|
4
|
|
|
|
|
116
|
my $self = bless { _CONTEXT => $context, }, $class; |
15
|
4
|
|
|
|
|
12
|
return $self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _filter_factory { |
19
|
4
|
|
|
4
|
|
10
|
my $class = shift; |
20
|
|
|
|
|
|
|
my $code = sub { |
21
|
4
|
|
|
4
|
|
236
|
my ( $context, @args ) = @_; |
22
|
|
|
|
|
|
|
return sub { |
23
|
4
|
|
|
|
|
74
|
my $text = shift; |
24
|
4
|
|
|
|
|
23
|
fold( text => $text, length => $args[0], mode => $args[1] ); |
25
|
4
|
|
|
|
|
23
|
}; |
26
|
4
|
|
|
|
|
24
|
}; |
27
|
4
|
|
|
|
|
106
|
return [ $code => 1 ]; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
__END__ |