FA-96094 / Postal address normalization / Member archive
City-state-code last line parser: any ten-digit token is taken as a code · case 04
"1110112345" is accepted as a postal code.
Case contract
Uppercase, turn commas into spaces and split. If the last token is 5 digits or 5 digits, hyphen, 4 digits it is the code and is removed. The new last token must be a state in the toy table (ZZ, QX, XJ or the spelled names ZEDLAND, QUIXOTA, XANJOR mapping to them) and at least one city token must precede it. Return [city, state code, postal code or ""] or None.
Why this case matters
Last lines are parsed from the right because city names have any number of words; a mistaken boundary moves words between city, state and code.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| ten bare digits are not a code | ["QUILLBY", "ZZ", "4440412345"] | null | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗