street-address-rb / street-address

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

Fail to parse US address that contains alpha character in street number. #11

Open placeiq opened 11 years ago

placeiq commented 11 years ago

1.9.3p392 :001 > require 'street_address' => true 1.9.3p392 :002 > address = 'N4785 19th Avenue, Montello, WI 53949' => "N4785 19th Avenue, Montello, WI 53949" 1.9.3p392 :003 > parsed = StreetAddress::US.parse(address) => nil

From USPS Publication 28 - Postal Addressing Standards http://pe.usps.com/text/pub28/28apd_004.htm

Certainly an edge case that exists for Wisconsin and Northern Illinois but a valid address nonetheless. This address is for the 'White Lake Beach Resort' in Wisconsin.

jbielick commented 10 years ago

+1

address like "W298N408 Kings Way Delafield, WI" cannot be parsed.

derrek commented 10 years ago

@jbielick I'll hopefully have some time in the next few weeks to look at your fork and pull in changes. I've been awfully unavailable for about a year.

jbielick commented 10 years ago

@derrek Sounds good! Didn't make a PR because this change https://github.com/jbielick/street-address/commit/1b4918a29ffd1282534d97cef44cdc05a179fc3b#diff-d600f5977d5f908173320ad5fef33c40R592 may be application-specific and not a good change for the repo as a whole, but it does have some positive implications in cases like #10

Definitely willing to help out if I can!

jDeppen commented 9 years ago

Not sure if this street number issue is related "7857-A".

address = StreetAddress::US.parse("7857-A Estrada Ave Fort Knox, KY 40121")
=> #<StreetAddress::US::Address:0x007fa9cb8d96a0 @number="7857-", @street="A Estrada Ave", @street_type="Ft", @unit=nil, @unit_prefix=nil, @suffix=nil, @prefix=nil, @city="Knox", @state="KY", @postal_code="40121", @postal_code_ext=nil>

number: "7857-" but should be "7857-A" street: "A Estrada Ave" but should be "Estrada" street_type: "Ft" should be "Ave" city: "Knox" should be "Fort Knox"