Years ago, a report somebody had built for us blew up on some addresses in the Midwest. A look at the addresses showed values of the form "12345E State Road 5". The control that read the house number interpreted as a number in scientific format, and of course had no provision for a number that large. Dropping a space in before the "E"s allowed the report to run.
This is an odd case, in that the house number is a "number": in the US it generally indicates distance from some fixed line, and the parity can indicate which side of the street it falls on. But then people will write them with As, Bs, Es, etc. attached.
If something is sometimes a number, then it’s not a number. Address numbers in the US are just identifiers that use digits, and sometimes they are derived from some other factor that is a (or multiple!) number.
In the U.S. it's possible "12345E State Road 5" and "12345 E State Road 5" are different addresses depending on if the streets have directional suffixes and how they're interpreted (east and west)
I'm not sure how mail carrier software works, but in general there's a lot of variations of the same address that still lead to mail getting delivered correctly (and some addresses where the mail can't be delivered at all)
For U.S. apartments, usually any of these work
"123A Some St"
"123 Some St #A"
"123 Some St Apt A"
"123 Some St Unit A"
>I'm not sure how mail carrier software works, but in general there's a lot of variations of the same address that still lead to mail getting delivered correctly (and some addresses where the mail can't be delivered at all)
USPS has a canonical list of all valid addresses. In most cases of hand written letters, it comes down to a human’s judgement call.
Canada Post also has a canonical list of all valid addresses.
I live in an apartment, let's say unit 555 at 123 Main St, and my canonical address has the form 555-123 Main St. This is not unusual in any way.
It is vanishingly rare to find a business, software, or customer service agent that is willing to enter this address correctly, even when dealing with my provincial government or my federal government. They always want to put "Apartment" or "Unit", or move the apartment number after the street, or some other transformation.
Someone should write a bot to post a reminder to "start with strings unless you're doing math" to reddit/twitter/youtube every week and the world would probably be way better for it. We could even have compiler warnings for type-safe languages when someone declares an int with a name containing 'address/zip/postal/credit/card'
> But then people will write them with As, Bs, Es, etc. attached.
This is fairly commonly used for multi-unit dwellings, especially when someone turns a "normal" house (with a purely numeric street address) into multiple units, including renting out their basement.
In subdivisions the houses are often consecutive numbers (with odd/even numbers on opposite sides of the road), and it's not like the city is going to re-number every other house on the street.
This is also often how you end up with 1/2 addresses - a lot is split and rather than renumber the block, they have one of the lots keep the original and the gets (e.g.) 408 1/2.
And that's why I have a home address that doubles as an input fuzzer.
House numbers are not numbers in plenty of cases. Youy'll probably want to account at least somewhat for international addresses too, since most companies end up dealing with them sooner or later, if only to tell the customer you won't ship there.
I run into this sort of thing somewhat frequently. A multinational food delivery company here had a period for a couple years where it'd parse "1st whateverstreet 123" as an address on whateverstreer with the number "1st", dropping the 123 entirely. This may seem a bit silly but keep in mind that over here "123 Annex B" is a valid house number for instance, which might be a different building from "123B".
I had problems with practically every form that had an address entry when I had an address that was “State Road <number>”. Most validators interpret that as a road called State Road and reject the number. This also caused problems when I was telling my address to people on the phone who were apparently entering it into a form. The road had no alternate name and “Highway 142” didn’t work either.
Quite so. Not far outside Cleveland, Ohio, is the "Parma Triangle" formed by State Road, Pearl Road, and Snow Road. Is State Road a state road? I don't know.
This is an odd case, in that the house number is a "number": in the US it generally indicates distance from some fixed line, and the parity can indicate which side of the street it falls on. But then people will write them with As, Bs, Es, etc. attached.