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.104'; |
4
|
5
|
|
|
5
|
|
135660
|
use strict; |
|
5
|
|
|
|
|
21
|
|
|
5
|
|
|
|
|
147
|
|
5
|
5
|
|
|
5
|
|
27
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
975
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
2
|
|
|
2
|
0
|
329
|
my $class = shift; |
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
|
|
6
|
my $self = { |
11
|
|
|
|
|
|
|
}; |
12
|
2
|
|
|
|
|
6
|
bless $self, $class; |
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
|
|
8
|
return $self; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub filter { |
18
|
2
|
|
|
2
|
0
|
9
|
my $self = shift; |
19
|
2
|
|
|
|
|
6
|
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
|
|
|
|
|
41
|
$row =~ s/[[:alpha:]]+/a/g; |
27
|
9
|
|
|
|
|
27
|
$row =~ s/\d+/0/g; |
28
|
9
|
50
|
|
|
|
22
|
next if ($row eq ''); |
29
|
|
|
|
|
|
|
|
30
|
9
|
|
|
|
|
22
|
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.104 |
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 |