| 1 | package String::Normal::Type::City; | ||||||||||
| 2 | 9 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 9 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 9 | ▶ | use String::Normal::Type; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 9 | ▶ | use String::Normal::Config; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 9 | our $address_stem; | |||||||||
| 8 | |||||||||||
| 9 | 2 | ▶ | sub transform { | ||||||||
|
Subroutine
transform: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 10 | 2 | my ($self,$value) = @_; | |||||||||
| 11 | |||||||||||
| 12 | 2 | $value = String::Normal::Type::_scrub_value( $value ); | |||||||||
| 13 | |||||||||||
| 14 | # TODO: refactor this code and remove dependencies on %address_stem | ||||||||||
| 15 | # single spaced records are guaranteed | ||||||||||
| 16 | 2 | my @tokens = (); | |||||||||
| 17 | 2 | for my $token (split ' ', $value) { | |||||||||
| 18 | 4 | ▶ | $token = defined( $address_stem->{$token} ) ? $address_stem->{$token} : $token; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 4 | push @tokens, $token; | |||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 2 | $value = join ' ', @tokens; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 26 | 1 | my $self = shift; | |||||||||
| 27 | 1 | $address_stem = String::Normal::Config::AddressStem::_data( @_ ); | |||||||||
| 28 | 1 | return bless {@_}, $self; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 9 | 1; | |||||||||
| 32 | |||||||||||
| 33 | __END__ | ||||||||||