File Coverage

blib/lib/School/Code/Compare/Charset/NumSignes.pm
Criterion Covered Total %
statement 20 20 100.0
branch 1 2 50.0
condition n/a
subroutine 4 4 100.0
pod 0 2 0.0
total 25 28 89.2


line stmt bran cond sub pod time code
1             package School::Code::Compare::Charset::NumSignes;
2             # ABSTRACT: collapse words and numbers into abstract placeholders
3             $School::Code::Compare::Charset::NumSignes::VERSION = '0.103'; # TRIAL
4 5     5   138965 use strict;
  5         18  
  5         150  
5 5     5   25 use warnings;
  5         26  
  5         977  
6              
7             sub new {
8 2     2 0 317 my $class = shift;
9              
10 2         6 my $self = {
11             };
12 2         5 bless $self, $class;
13              
14 2         8 return $self;
15             }
16              
17             sub filter {
18 2     2 0 8 my $self = shift;
19 2         5 my $lines_ref = shift;
20              
21 2         4 my @numsignes;
22              
23 2         5 foreach my $row (@{$lines_ref}) {
  2         6  
24              
25             #$row =~ s/[:alpha:]/a/g;
26 9         39 $row =~ s/[[:alpha:]]+/a/g;
27 9         25 $row =~ s/\d+/0/g;
28 9 50       24 next if ($row eq '');
29              
30 9         21 push @numsignes, $row;
31             }
32              
33 2         9 return \@numsignes;
34             }
35              
36             1;
37              
38             __END__
39              
40             =pod
41              
42             =encoding UTF-8
43              
44             =head1 NAME
45              
46             School::Code::Compare::Charset::NumSignes - collapse words and numbers into abstract placeholders
47              
48             =head1 VERSION
49              
50             version 0.103
51              
52             =head1 AUTHOR
53              
54             Boris Däppen <bdaeppen.perl@gmail.com>
55              
56             =head1 COPYRIGHT AND LICENSE
57              
58             This software is copyright (c) 2020 by Boris Däppen.
59              
60             This is free software; you can redistribute it and/or modify it under
61             the same terms as the Perl 5 programming language system itself.
62              
63             =cut