street-address-rb / street-address

Detect, and dissect, US Street Addresses in strings.
MIT License
168 stars 85 forks source link

PO Boxes not parsed properly #38

Open etcook opened 7 years ago

etcook commented 7 years ago

I'm running into an issue where the gem isn't parsing PO Boxes properly

[6] pry(main)> StreetAddress::US.parse("PO Box 253, Cream Ridge NJ 08514-0253") => nil

etcook commented 7 years ago

Looks like the ruby gems version was old, so I'm using the git repo directly, however I'm running into a new issue:

[1] pry(main)> StreetAddress::US.parse("PO Box 253, Cream Ridge, NJ 08514-0253") => #<StreetAddress::US::Address:0x007ff2539aadb0 @redundant_street_type=false, @street="Cream", @street_type="Rdg", @unit="253", @unit_prefix="Po Box">

If it's a PO Box, there is no street, but it's interpreting the city as the street.