FA-96099 / Postal address normalization / Member archive
City-state-code last line parser: a last line without a city is accepted · case 04
"ZZ 11101" parses with an empty city.
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 |
|---|---|---|---|
| missing city | ["", "ZZ", "44404"] | 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 ↗