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   64 use strict;
  9         17  
  9         357  
3 9     9   56 use warnings;
  9         36  
  9         511  
4              
5 9     9   5407 use String::Normal::Type::Business;
  9         30  
  9         379  
6 9     9   4935 use String::Normal::Type::Address;
  9         31  
  9         415  
7 9     9   4929 use String::Normal::Type::Phone;
  9         34  
  9         361  
8 9     9   4748 use String::Normal::Type::State;
  9         29  
  9         336  
9 9     9   4853 use String::Normal::Type::City;
  9         28  
  9         327  
10 9     9   5059 use String::Normal::Type::Zip;
  9         29  
  9         409  
11 9     9   4796 use String::Normal::Type::Title;
  9         29  
  9         1853  
12              
13             sub _scrub_value {
14 23     23   48 my $value = shift;
15              
16 23         206 $value = _deaccent_value( $value );
17 23         50 $value =~ tr/'//d;
18              
19             # replace all rejected charactes with space
20 23         201 $value =~ s/[^a-z0-9#]/ /g;
21              
22 23         71 return $value
23             }
24              
25             sub _deaccent_value {
26 23     23   44 my $value = shift;
27              
28             # remove decorations and stem variations of single quotes
29 23         48 $value =~ tr[àáâãäåæçèéêëìíîïñòóôõöøùúûüýÿ’`\x92]
30             [aaaaaaaceeeeiiiinoooooouuuuyy'''];
31              
32 23         61 return $value;
33             }
34              
35             1;
36              
37             __END__