File Coverage

blib/lib/String/Normal/Type.pm
Criterion Covered Total %
statement 35 35 100.0
branch n/a
condition n/a
subroutine 11 11 100.0
pod n/a
total 46 46 100.0


line stmt bran cond sub pod time code
1             package String::Normal::Type;
2 9     9   37 use strict;
  9         11  
  9         188  
3 9     9   26 use warnings;
  9         11  
  9         158  
4              
5 9     9   3084 use String::Normal::Type::Business;
  9         13  
  9         239  
6 9     9   3368 use String::Normal::Type::Address;
  9         12  
  9         189  
7 9     9   2984 use String::Normal::Type::Phone;
  9         14  
  9         188  
8 9     9   3055 use String::Normal::Type::State;
  9         15  
  9         168  
9 9     9   2981 use String::Normal::Type::City;
  9         9  
  9         185  
10 9     9   2857 use String::Normal::Type::Zip;
  9         13  
  9         228  
11 9     9   2925 use String::Normal::Type::Title;
  9         11  
  9         823  
12              
13             sub _scrub_value {
14 23     23   32 my $value = shift;
15              
16 23         36 $value = _deaccent_value( $value );
17 23         24 $value =~ tr/'//d;
18              
19             # replace all rejected charactes with space
20 23         112 $value =~ s/[^a-z0-9#]/ /g;
21              
22 23         50 return $value
23             }
24              
25             sub _deaccent_value {
26 23     23   25 my $value = shift;
27              
28             # remove decorations and stem variations of single quotes
29 23         29 $value =~ tr[àáâãäåæçèéêëìíîïñòóôõöøùúûüýÿ’`\x92]
30             [aaaaaaaceeeeiiiinoooooouuuuyy'''];
31              
32 23         35 return $value;
33             }
34              
35             1;
36              
37             __END__