street-address-rb / street-address

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

Fix addresses with a dirty ordinal indicator. #39

Open seabre opened 7 years ago

seabre commented 7 years ago

Hi! Over at CrowdFiber we have a lot of parcel data with addresses and frequently encounter cases like 1 1 ST St, e San Jose CA. We expect the parser to produce an address like 1 1st St, East San Jose, CA but without this fix 1 1 St St, East San Jose, CA is what we get.

We could fix this in post processing, but it makes more sense to take this case into account inside StreetAddress::US since we encounter it so often.

I've added test cases based on addresses in StreetAddress::US test suite and modified to match the issue we're encountering. My changes pass the test suite and we have been using this code in production.