Skip Menu |

This queue is for tickets about the Lingua-EN-AddressParse CPAN distribution.

Report information
The Basics
Id: 117872
Status: resolved
Priority: 0/
Queue: Lingua-EN-AddressParse

People
Owner: Nobody in particular
Requestors: NHORNE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.26
Fixed in: 1.26



Subject: Doesn't work in simple example
I couldn't get it to work, so in order to try to work out what I'd done wrong I created a simple example, but even that doesn't work: $ cat l #!/usr/bin/env perl use Lingua::EN::AddressParse; my $ap = Lingua::EN::AddressParse->new(country => 'US'); my $error = $ap->parse('1 Main St, Silver Spring, MD, USA'); die $error if($error); print $ap->report(); $ ./l 1 at ./l line 8. $
By default the parser assumes your address has a zip code in it. But by setting the force_post_code_flag to 0 you can get around this, my $ap = Lingua::EN::AddressParse->new(country => 'US', , force_post_code => 0); my $error = $ap->parse('1 Main St, Silver Spring, MD, USA'); die $error if($error); print $ap->report(); Original Input '1 Main St, Silver Spring, MD, USA' Cleaned Input '1 MAIN ST SILVER SPRING MD USA ' Country address format 'US' Address type 'suburban' Non matching part '' Error '0' Error descriptions '' Warning '0' Warning description '' Case all '1 Main St Silver Spring MD USA' COMPONENTS '' base_street_name 'Main' building '' country 'USA' level '' po_box_type '' post_box '' post_code '' pre_cursor '' property_identifier '1' property_name '' road_box '' street_direction_prefix '' street_direction_suffix '' street_name 'Main' street_type 'St' sub_property_identifier '' sub_property_type '' subcountry 'MD' suburb 'Silver Spring '