Branch Coverage

File:blib/lib/Geo/Coder/Free/OpenAddresses.pm
Coverage:1.0%

line%coveragebranch
10550TFunless $class
10750TFif (my $openaddr = $param{"openaddr"})
108100TFunless -d $openaddr and -r $openaddr
1460TFif (ref $_[0] eq 'HASH') { }
0TFelsif (ref $_[0]) { }
0TFelsif (scalar(@_) % 2 == 0) { }
1570TFif ($param{"ignore_words"})
1610TFif (my $scantext = $param{"scantext"})
1620TFif length $scantext < 6
1700TFif ($region)
1740TFif (length $words[$offset] < 2)
1780TFif (exists $ignore_words{lc $words[$offset]})
1830TFif ($l = $self->geocode("location", $words[$offset]) and ref $l)
1860TFif ($offset < $count - 1)
1880TFif (length $addr == 0)
1930TFif ($addr =~ /\s+(\d{2,5}\s+)(?![a|p]m\b)(([a-zA-Z|\s+]{1,5}){1,2})?([\s|\,|.]+)?(([a-zA-Z|\s+]{1,30}){1,4})(court|ct|street|st|drive|dr|lane|ln|road|rd|blvd)([\s|\,|.|\;]+)?(([a-zA-Z|\s+]{1,30}){1,2})([\s|\,|.]+)?\b(AK|AL|AR|AZ|CA|CO|CT|DC|DE|FL|GA|GU|HI|IA|ID|IL|IN|KS|KY|LA|MA|MD|ME|MI|MN|MO|MS|MT|NC|ND|NE|NH|NJ|NM|NV|NY|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VA|VI|VT|WA|WI|WV|WY)([\s|\,|.]+)?(\s+\d{5})?([\s|\,|.]+)/i) { }
0TFelsif ($addr =~ /\s+(\d{2,5}\s+)(?![a|p]m\b)(([a-zA-Z|\s+]{1,5}){1,2})?([\s|\,|.]+)?(([a-zA-Z|\s+]{1,30}){1,4})(court|ct|street|st|drive|dr|lane|ln|road|rd|blvd)([\s|\,|.|\;]+)?(([a-zA-Z|\s+]{1,30}){1,2})([\s|\,|.]+)?\b(AB|BC|MB|NB|NL|NT|NS|ON|PE|QC|SK|YT)([\s|\,|.]+)?(\s+\d{5})?([\s|\,|.]+)/i) { }
0TFelsif ($addr =~ /([a-zA-Z|\s+]{1,30}){1,2}([\s|\,|.]+)?\b(AK|AL|AR|AZ|CA|CO|CT|DC|DE|FL|GA|GU|HI|IA|ID|IL|IN|KS|KY|LA|MA|MD|ME|MI|MN|MO|MS|MT|NC|ND|NE|NH|NJ|NM|NV|NY|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VA|VI|VT|WA|WI|WV|WY)/i) { }
0TFelsif ($addr =~ /([a-zA-Z|\s+]{1,30}){1,2}([\s|\,|.]+)?\b(AB|BC|MB|NB|NL|NT|NS|ON|PE|QC|SK|YT)/i) { }
1940TFunless ($region and $region ne "US")
1950TFif ($l = $self->geocode("location", "$addr, US") and ref $l)
2030TFunless ($region and $region ne "CA")
2040TFif ($l = $self->geocode("location", "$addr, Canada") and ref $l)
2120TFunless ($region and $region ne "US")
2130TFif ($l = $self->geocode("location", "$addr, US") and ref $l)
2230TFunless ($region and $region ne "CA")
2240TFif ($l = $self->geocode("location", "$addr, Canada") and ref $l)
2340TFif ($region and ($l = $self->geocode('location', "$addr, $region") and ref $l)) { }
0TFelsif (not $region and ($l = $self->geocode('location', $addr) and ref $l)) { }
2450TFif ($offset < $count - 2)
2470TFif ($l = $self->geocode("location", $addr) and ref $l)
2680TFunless my $location = $param{"location"}
2740TFif ($location =~ /^,\s*(.+)/)
2790TFunless ($location =~ /\D/)
2830TFif length $location <= 1
2850TFif ($location =~ /^(.+),?\s*Washington\s*DC$/i) { }
0TFelsif ($location =~ /^(.*),?\s*Saint Louis, (Missouri|MO)(.*)$/) { }
2920TFif (my $rc = $known_locations{$location})
3120TFunless ($location =~ /,/)
3130TFif ($location =~ /^(.+?)\s+(United States|USA|US)$/i) { }
0TFelsif ($location =~ /^(.+?)\s+(England|Scotland|Wales|Northern Ireland|UK|GB)$/i) { }
0TFelsif ($location =~ /^(.+?)\s+Canada$/i) { }
3150TFif (my $rc = $self->_get($l, "US"))
3200TFif (my $rc = $self->_get($l, "US"))
3270TFif (my $rc = $self->_get($l, "GB"))
3340TFif (my $rc = $self->_get($l, "CA"))
3410TFif ($location =~ /USA$/ or $location =~ /United States$/) { }
0TFelsif ($location =~ /(England|Scotland|Wales|Northern Ireland|UK|GB)$/i) { }
0TFelsif ($location =~ /Canada$/) { }
0TFelsif ($location =~ /Australia$/) { }
3540TFif ($ap)
3560TFif ($l =~ /(.+), (England|UK)$/i)
3590TFif ($ap->parse($l)) { }
3670TFif (my $type = $c{"street_type"})
3680TFif (my $a = &Geo::Coder::Free::_abbreviate($type)) { }
3730TFif (my $suffix = $c{"street_direction_suffix"})
3790TFif (length $c{'subcountry'} == 2) { }
3820TFif ($c{'country'} =~ /Canada/i) { }
0TFelsif ($c{'country'} =~ /^(United States|USA|US)$/i) { }
0TFelsif ($c{'country'}) { }
3840TFif (my $twoletterstate = "Locale::CA"->new->{"province2code"}{uc $c{"subcountry"}})
3890TFif (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $c{"subcountry"}})
3940TFif ($c{"subcountry"})
4020TFif ($addr{"house_number"})
4030TFif (my $rc = $self->_search(\%addr, ("house_number", "road", "city", "state", "country")))
4070TFunless ($addr{"house_number"} and $param{"exact"})
4080TFif (my $rc = $self->_search(\%addr, ("road", "city", "state", "country")))
4150TFif ($location =~ /^(.+?)[,\s]+(United States|USA|US)$/i)
4230TFif (not $location =~ /\sCounty,/i and my $href = 'Geo::StreetAddress::US'->parse_location($l) || 'Geo::StreetAddress::US'->parse_address($l))
4250TFif ($state = $$href{"state"})
4260TFif (length $state > 2)
4270TFif (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $state})
4320TFif ($$href{"city"})
4350TFif ($street = $$href{"street"})
4360TFif ($$href{"type"} and my $type = &Geo::Coder::Free::_abbreviate($$href{"type"}))
4390TFif ($$href{"suffix"})
4420TFif (my $prefix = $$href{"prefix"})
4450TFif ($$href{"number"})
4460TFif (my $rc = $self->_get($$href{"number"}, "$street$city$state", "US"))
4510TFif (my $rc = $self->_get("$street$city$state", "US"))
4610TFif (scalar @addr == 5)
4640TFif (length $state > 2)
4650TFif (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $state})
4690TFif (length $state == 2)
4720TFif (my $rc = $self->_get($addr[0], $addr[1], $addr[2], $state, "US"))
4790TFif (length $state == 2)
4830TFif (my $rc = $self->_get($addr[0], $addr[1], $addr[2], $state, "US"))
4880TFif (my $rc = $self->_get($addr[0], $addr[1], $state, "US"))
4970TFif ($location =~ /(.+),\s*([\s\w]+),\s*([\w\s]+)$/) { }
0TFelsif ($location =~ /([a-z\s]+),?\s*(United States|USA|US|Canada)$/i) { }
5060TFif (uc $country eq 'ENGLAND' or uc $country eq 'SCOTLAND' or uc $country eq 'WALES') { }
5140TFif ($c)
5150TFif ($c eq 'us') { }
0TFelsif ($c eq 'ca') { }
5160TFif (length $state > 2)
5170TFif (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $state})
5230TFif (not $city =~ /,/) { }
0TFelsif (my $href = 'Geo::StreetAddress::US'->parse_address("$city, $state")) { }
5250TFif ($city =~ /^(.+)\sCOUNTY$/) { }
5270TFif ($rc = $self->_get("$1$state", "US"))
5330TFif ($rc = $self->_get("$city$state", "US"))
5450TFif (length $state > 2)
5460TFif (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $state})
5500TFif ($$href{"city"})
5560TFif ($street = $fullstreet)
5590TFif (my $type = &Geo::Coder::Free::_abbreviate($$href{"type"}))
5620TFif ($$href{"suffix"})
5670TFif ($street)
5690TFif (my $prefix = $$href{"prefix"})
5730TFif ($$href{"number"})
5750TFif ($rc = $self->_get($$href{"number"}, "$street$city$state", "US"))
5790TFif ($rc = $self->_get($$href{"number"}, "$fullstreet$city$state", "US"))
5860TFif ($rc = $self->_get("$street$city$state", "US"))
5910TFif ($rc = $self->_get("$street$city$state", "US"))
5970TFif ($rc = $self->_get("$fullstreet$city$state", "US"))
6050TFif ($city =~ /^(\d.+),\s*([\w\s]+),\s*([\w\s]+)/) { }
0TFelsif ($city =~ /^(\w[\w\s]+),\s*([\w\s]+)/) { }
6070TFif (my $href = 'Geo::StreetAddress::US'->parse_address($lookup) || 'Geo::StreetAddress::US'->parse_location($lookup))
6130TFif ($$href{'state'}) { }
6180TFif (length $state > 2)
6190TFif (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $state})
6240TFif ($$href{"city"})
6270TFif ($$href{"number"})
6300TFif ($street = $$href{"street"})
6310TFif (my $type = &Geo::Coder::Free::_abbreviate($$href{"type"}))
6340TFif ($$href{"suffix"})
6370TFif (my $prefix = $$href{"prefix"})
6410TFif ($$href{"number"})
6420TFif ($county)
6430TFif ($rc = $self->_get($$href{"number"}, "$street$city$county$state", "US"))
6480TFif ($rc = $self->_get($$href{"number"}, "$street$city$state", "US"))
6520TFif ($county)
6530TFif ($rc = $self->_get("$street$city$county$state", "US"))
6580TFif ($rc = $self->_get("$street$city$state", "US"))
6720TFif ($second =~ /(\d+)\s+(.+)/)
6750TFif ($rc = $self->_get("$first$second$state", "US"))
6820TFif ($rc = $self->_get("$first$second$state", "US"))
6870TFif ($rc = $self->_get("$first$state", "US"))
6950TFif ($rc = $self->_get($copy, "US"))
6990TFif ($copy =~ s/(\d+)\s+/$1/)
7000TFif ($rc = $self->_get($copy, "US"))
7090TFif (length $state > 2)
7100TFif (my $twoletterstate = "Locale::CA"->new->{"province2code"}{uc $state})
7150TFif (not $city =~ /,/) { }
0TFelsif (my $href = 0) { }
7180TFif ($rc = $self->_get("$city$state", "CA"))
7260TFif (length $state > 2)
7270TFif (my $twoletterstate = "Locale::CA"->new->{"province2code"}{uc $state})
7320TFif ($$href{"city"})
7350TFif ($$href{"number"})
7380TFif ($street = $$href{"street"})
7390TFif (my $type = &Geo::Coder::Free::_abbreviate($$href{"type"}))
7420TFif ($$href{"suffix"})
7460TFif ($street)
7470TFif (my $prefix = $$href{"prefix"})
7540TFif ($city =~ /^(\w[\w\s]+),\s*([\w\s]+)/)
7590TFif ($rc = $self->_get("$first$second$state", "CA"))
7660TFif ($rc = $self->_get("$first$second$state", "CA"))
7710TFif ($rc = $self->_get("$first$state", "CA"))
7790TFif ($rc = $self->_get($copy, "CA"))
7830TFif ($copy =~ s/(\d+)\s+/$1/)
7840TFif ($rc = $self->_get($copy, "CA"))
7950TFif ($c eq "au" and length $state > 3)
7960TFif (my $abbrev = "Locale::SubCountry"->new("AU")->code(ucfirst lc $state))
7970TFif ($abbrev ne "unknown")
8020TFif ($city =~ /^(\w[\w\s]+),\s*([,\w\s]+)/)
8070TFif ($street =~ /^(\d+)\s+(.+)/)
8130TFif ($city eq "MINSTER, THANET")
8170TFif ($number)
8180TFif (my $rc = $self->_get("$number$street$city$state$c"))
8230TFif (my $rc = $self->_get("$street$city$state$c"))
8270TFunless ($street and $param{"exact"})
8280TFif (my $rc = $self->_get("$city$state$c"))
8460TFif ($country =~ /Canada/i) { }
8480TFif (length $state > 2)
8490TFif (my $twoletterstate = "Locale::CA"->new->{"province2code"}{uc $state})
8550TFif (length $state > 2)
8560TFif (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $state})
8610TFif (my $rc = $self->_get("$state$country"))
8670TFif ($country)
8680TFunless "Geo::Address::Parser"->can("parse")
8700TFif ($country eq "US")
8720TFif (my $fields = $addr_parser->parse($location))
8740TFunless defined $$fields{$key}
8760TFif (my $rc = $self->_search($fields, keys %{$fields;}))
8860TFif ($libpostal_is_installed == 0)
8870TFif (eval {         do {         require Geo::libpostal } }) { }
8980TFif ($libpostal_is_installed == 1 and my(%addr) = Geo::libpostal::parse_address($location))
9000TFif ($addr{"country"} and $addr{"state"} and $addr{"country"} =~ /^(Canada|United States|USA|US)$/i)
9010TFif ($street = $addr{"road"})
9050TFif ($addr{'country'} =~ /Canada/i) { }
9070TFif (length $addr{"state"} > 2)
9080TFif (my $twoletterstate = "Locale::CA"->new->{"province2code"}{uc $addr{"state"}})
9140TFif (length $addr{"state"} > 2)
9150TFif (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $addr{"state"}})
9200TFif ($addr{"state_district"})
9220TFif (my $rc = $self->_search(\%addr, ("house_number", "road", "city", "state_district", "state", "country")))
9260TFif (my $rc = $self->_search(\%addr, ("house_number", "road", "city", "state", "country")))
9290TFif ($addr{"house_number"})
9300TFif (my $rc = $self->_search(\%addr, ("road", "city", "state", "country")))
9360TFif ($location =~ s/,//g)
9490TFif ($$data{$column})
9530TFif ($location)
9720TFif (length $location <= 16) { }
9840TFif (defined $unknown_locations{$digest})
9920TFif (my $cache = $$self{"cache"})
9930TFif (my $rc = $cache->get_object($digest))
10060TFif (my $geohash = $openaddr_db->geohash("md5", $digest))
10180TFif (my $cache = $$self{"cache"})