Skip to content

Commit

Permalink
More incorporations of G:C:A
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Oct 5, 2020
1 parent b2c7a75 commit 6dd70cf
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 51 deletions.
4 changes: 2 additions & 2 deletions createdatabase.PL
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ my %known_places = ( # Places I've checked with my GPS
'LAT' => 39.29491,
'LON' => -76.78051,
'NUMBER' => 8020,
'STREET' => 'BALTIMORE NATIONAL PIKE',
'STREET' => 'BALTIMORE NATIONAL PK',
'CITY' => 'ELLICOTT CITY',
'COUNTY' => 'HOWARD',
'STATE' => 'MD',
Expand Down Expand Up @@ -400,7 +400,7 @@ my %known_places = ( # Places I've checked with my GPS
'LAT' => 39.05798753,
'LON' => -77.12165374,
'NUMBER' => 12276,
'STREET' => 'ROCKVILLE PIKE',
'STREET' => 'ROCKVILLE PK',
'CITY' => 'ROCKVILLE',
'COUNTY' => 'MONTGOMERY',
'STATE' => 'MD',
Expand Down
92 changes: 46 additions & 46 deletions lib/Geo/Coder/Free.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use warnings;
use lib '.';

use Config::Auto;
# use Geo::Coder::Abbreviations;
use Geo::Coder::Abbreviations;
use Geo::Coder::Free::MaxMind;
use Geo::Coder::Free::OpenAddresses;
use List::MoreUtils;
Expand Down Expand Up @@ -309,51 +309,51 @@ sub run {
sub _normalize($) {
my $type = uc(shift);

# return Geo::Coder::Abbreviations->new()->abbreviate($type);

if(($type eq 'AVENUE') || ($type eq 'AVE')) {
return 'AVE';
} elsif(($type eq 'STREET') || ($type eq 'ST')) {
return 'ST';
} elsif(($type eq 'ROAD') || ($type eq 'RD')) {
return 'RD';
} elsif(($type eq 'COURT') || ($type eq 'CT')) {
return 'CT';
} elsif(($type eq 'CIR') || ($type eq 'CIRCLE')) {
return 'CIR';
} elsif(($type eq 'FT') || ($type eq 'FORT')) {
return 'FT';
} elsif(($type eq 'CTR') || ($type eq 'CENTER')) {
return 'CTR';
} elsif(($type eq 'PARKWAY') || ($type eq 'PKWY')) {
return 'PKWY';
} elsif($type eq 'BLVD') {
return 'BLVD';
} elsif($type eq 'PIKE') {
return 'PIKE';
} elsif(($type eq 'DRIVE') || ($type eq 'DR')) {
return 'DR';
} elsif(($type eq 'SPRING') || ($type eq 'SPG')) {
return 'SPRING';
} elsif(($type eq 'RDG') || ($type eq 'RIDGE')) {
return 'RDG';
} elsif(($type eq 'CRK') || ($type eq 'CREEK')) {
return 'CRK';
} elsif(($type eq 'LANE') || ($type eq 'LN')) {
return 'LN';
} elsif(($type eq 'PLACE') || ($type eq 'PL')) {
return 'PL';
} elsif(($type eq 'GRDNS') || ($type eq 'GARDENS')) {
return 'GRDNS';
} elsif(($type eq 'HWY') || ($type eq 'HIGHWAY')) {
return 'HWY';
}

# Most likely failure of Geo::StreetAddress::US, but warn anyway, just in case
if($ENV{AUTHOR_TESTING}) {
# warn $self->{'location'}, ": add type $type";
warn "Add type $type";
}
return Geo::Coder::Abbreviations->new()->abbreviate($type);

# if(($type eq 'AVENUE') || ($type eq 'AVE')) {
# return 'AVE';
# } elsif(($type eq 'STREET') || ($type eq 'ST')) {
# return 'ST';
# } elsif(($type eq 'ROAD') || ($type eq 'RD')) {
# return 'RD';
# } elsif(($type eq 'COURT') || ($type eq 'CT')) {
# return 'CT';
# } elsif(($type eq 'CIR') || ($type eq 'CIRCLE')) {
# return 'CIR';
# } elsif(($type eq 'FT') || ($type eq 'FORT')) {
# return 'FT';
# } elsif(($type eq 'CTR') || ($type eq 'CENTER')) {
# return 'CTR';
# } elsif(($type eq 'PARKWAY') || ($type eq 'PKWY')) {
# return 'PKWY';
# } elsif($type eq 'BLVD') {
# return 'BLVD';
# } elsif($type eq 'PIKE') {
# return 'PIKE';
# } elsif(($type eq 'DRIVE') || ($type eq 'DR')) {
# return 'DR';
# } elsif(($type eq 'SPRING') || ($type eq 'SPG')) {
# return 'SPRING';
# } elsif(($type eq 'RDG') || ($type eq 'RIDGE')) {
# return 'RDG';
# } elsif(($type eq 'CRK') || ($type eq 'CREEK')) {
# return 'CRK';
# } elsif(($type eq 'LANE') || ($type eq 'LN')) {
# return 'LN';
# } elsif(($type eq 'PLACE') || ($type eq 'PL')) {
# return 'PL';
# } elsif(($type eq 'GRDNS') || ($type eq 'GARDENS')) {
# return 'GRDNS';
# } elsif(($type eq 'HWY') || ($type eq 'HIGHWAY')) {
# return 'HWY';
# }

# # Most likely failure of Geo::StreetAddress::US, but warn anyway, just in case
# if($ENV{AUTHOR_TESTING}) {
# # warn $self->{'location'}, ": add type $type";
# warn "Add type $type";
# }
}

=head1 AUTHOR
Expand Down
4 changes: 2 additions & 2 deletions lib/Geo/Coder/Free/Local.pm
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ __DATA__
"",3516,"SW MACVICAR AVE","TOPEKA","SHAWNEE","KS","US",39.005175,-95.706681
"THE ATRIUM AT ROCK SPRING PARK",6555,"ROCKLEDGE DR","BETHESDA","MONTGOMERY","MD","US",39.028326,-77.136774
"","","MOUTH OF MONOCACY RD","DICKERSON","MONTGOMERY","MD","US",39.2244603797302,-77.449615439877
"PATAPSCO VALLEY STATE PARK'",8020,"BALTIMORE NATIONAL PIKE","ELLICOTT CITY","HOWARD","MD","US",39.29491,-76.78051
"PATAPSCO VALLEY STATE PARK'",8020,"BALTIMORE NATIONAL PK","ELLICOTT CITY","HOWARD","MD","US",39.29491,-76.78051
"UTICA DISTRICT PARK",,,"FREDERICK","FREDERICK","MD","US",39.5167883333333,-77.4015166666667
"ALBERT EINSTEIN HIGH SCHOOL",11135,"NEWPORT MILL RD","KENSINGTON","MONTGOMERY","MD","US",39.03869019,-77.0682871
"POST OFFICE",10325,"KENSINGTON PKWY","KENSINGTON","MONTGOMERY","MD","US",39.02554455,-77.07178215
Expand All @@ -601,7 +601,7 @@ __DATA__
"",1956,"SEMINARY RD","SILVER SPRING","MONTGOMERY","MD","US",39.008845,-77.043317
"",9315,"WARREN ST","SILVER SPRING","MONTGOMERY","MD","US",39.00881,-77.048953
"",9411,"WARREN ST","SILVER SPRING","MONTGOMERY","MD","US",39.010436,-77.04855
"SILVER DINER",12276,"ROCKVILLE PIKE","ROCKVILLE","MONTGOMERY","MD","US",39.05798753,-77.12165374
"SILVER DINER",12276,"ROCKVILLE PK","ROCKVILLE","MONTGOMERY","MD","US",39.05798753,-77.12165374
"",1605,"VIERS MILL RD","ROCKVILLE","MONTGOMERY","MD","US",39.07669788,-77.12306436
"",1406,"LANGBROOK PLACE","ROCKVILLE","MONTGOMERY","MD","US",39.075583,-77.123833
"BP",2601,"FOREST GLEN RD","SILVER SPRING","MONTGOMERY","MD","US",39.0147541,-77.05466857
Expand Down
2 changes: 1 addition & 1 deletion t/openaddr.t
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!perl -wT
#!perl -w

use warnings;
use strict;
Expand Down

0 comments on commit 6dd70cf

Please sign in to comment.