blib/lib/Template/Plugin/Lingua/EN/Inflexion.pm

filter: Statementstmt 100% 34 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 13 / 13 Podpod 100% 6 / 6 totaltotal 100% 53 / 53 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 #
2 #===============================================================================
3 #
4 # FILE: Inflexion.pm
5 #
6 # DESCRIPTION: Glue for Lingua::EN::Inflexion
7 #
8 # FILES: ---
9 # BUGS: ---
10 # NOTES: ---
11 # AUTHOR: Pete Houston (pete), cpan@openstrike.co.uk
12 # ORGANIZATION: Openstrike
13 # VERSION: See code
14 # CREATED: 13/08/19 16:56:03
15 # REVISION: ---
16 #===============================================================================
17 package Template::Plugin::Lingua::EN::Inflexion;
18  
19 4 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 4 our $VERSION = '0.01';
24  
25 4 ▶use parent 'Template::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
26 4 ▶use Lingua::EN::Inflexion 0.001008 'inflect';
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 10 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
29 10 my ($class, $context) = @_;
30  
31 10 ▶ my $filter_factory = sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
32 10 shift;
33 10 ▶ return sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
34 10 tt_inflect (@_);
35 10 };
36 10 };
37  
38 # plugin without options can be static
39 10 my $plugin = \&tt_inflect;
40  
41 # now define the filter and return the plugin
42 10 $context->define_filter ('inflect', [ $filter_factory => 1 ]);
43 10 return bless $plugin, $class;
44 }
45  
46 10 ▶sub tt_inflect {
Subroutine tt_inflect: called CC=1 SCAR=0.0
Pod documented
47 10 my $out = inflect (join ('', @_));
48 10 return $out;
49 }
50  
51 12 ▶sub noun { shift; return Lingua::EN::Inflexion::noun (shift); }
Subroutine noun: called CC=1 SCAR=0.0
Pod documented
52 9 ▶sub verb { shift; return Lingua::EN::Inflexion::verb (shift); }
Subroutine verb: called CC=1 SCAR=0.0
Pod documented
53 6 ▶sub adj { shift; return Lingua::EN::Inflexion::adj (shift); }
Subroutine adj: called CC=1 SCAR=0.0
Pod documented
54 4 ▶sub wordlist { shift; return Lingua::EN::Inflexion::wordlist (@_); }
Subroutine wordlist: called CC=1 SCAR=0.0
Pod documented
55  
56 4 1;
57  
58 __END__
↑ Summary