FA-95877 / Postal address normalization / Member archive
Secondary unit extractor: long designators are emitted verbatim · case 02
The unit reads "SUITE 100" and "APARTMENT 1B" instead of "STE 100" and "APT 1B".
Case contract
Input one uppercase-able street line. Split on whitespace. A final token "#ID" (with at least one character after #) becomes unit "# ID". Otherwise, if at least three tokens exist and the second-to-last token is a designator (APARTMENT/APT->APT, SUITE/STE->STE, UNIT, FLOOR/FL->FL, #), the last token is its identifier. Return [street, unit] with unit "" when none is found.
Why this case matters
Separating the secondary unit from the street line decides whether two deliveries go to the same building and which unit receives them.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| trailing apartment is split off | ["22 ELM ST", "APARTMENT 2B"] | ["22 ELM ST", "APT 2B"] | 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 ↗