FA-96291 / Postal address normalization / Open access
Address display casing: second hyphen part stays lowercase · case 01
"FAKE-SIDE" prints as "Fake-side".
ROOT CAUSE
The token is not split on hyphens before capitalization.
THE FAILURE
The token is not split on hyphens before capitalization.
Unsuccessful approach: Splitting on hyphens but rejoining with spaces changes the street name.
Case contract
Input a normalized uppercase line. Tokens in the keep set (PO, NE, NW, SE, SW, N, S, E, W, RR, HC) stay uppercase. Tokens starting with a digit keep the digits; an ordinal tail ST/ND/RD/TH is lowercased, any other tail (a unit letter) is kept. Other tokens are capitalized per hyphen part and per apostrophe part, and a part starting with MC is written Mc plus a capital.
Why this case matters
Normalized addresses are stored uppercase but printed on customer-facing documents; wrong casing of ordinals, directionals and unit letters looks like a different address.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
KEEP = {'PO', 'NE', 'NW', 'SE', 'SW', 'N', 'S', 'E', 'W', 'RR', 'HC'}
def cap(p):
if p.startswith('MC') and len(p) > 2:
return 'Mc' + p[2:3] + p[3:].lower()
return p[:1] + p[1:].lower()
out = []
for w in x.split():
if w in KEEP:
out.append(w)
elif w[0].isdigit():
n = 0
while n < len(w) and w[n].isdigit():
n += 1
tail = w[n:]
out.append(w[:n] + (tail.lower() if tail in ('ST', 'ND', 'RD', 'TH') else tail))
else:
parts = ["'".join(cap(q) for q in part.split("'")) for part in [w]]
out.append('-'.join(parts))
return ' '.join(out)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['numeric ordinal', '21ST ST', '21st St'], ['unit identifier keeps its letter', 'APT 1B', 'Apt 1B'], ['Mc surname street with directional', 'MCFAKE AVE NE', 'McFake Ave NE'], ['hyphenated street name', 'FAKE-SIDE RD', 'Fake-Side Rd'], ['apostrophe street name', "O'FAKE LN", "O'Fake Ln"], ['box line', 'PO BOX 12', 'PO Box 12'], ['standalone suffix', '5 FAKE ST', '5 Fake St']], [['numeric ordinal', '31ST ST', '31st St'], ['unit identifier keeps its letter', 'APT 2B', 'Apt 2B'], ['Mc surname street with directional', 'MCFAKE AVE NE', 'McFake Ave NE'], ['hyphenated street name', 'FAKE-SIDE RD', 'Fake-Side Rd'], ['apostrophe street name', "O'FAKE LN", "O'Fake Ln"], ['box line', 'PO BOX 13', 'PO Box 13'], ['standalone suffix', '6 FAKE ST', '6 Fake St']], [['numeric ordinal', '41ST ST', '41st St'], ['unit identifier keeps its letter', 'APT 3B', 'Apt 3B'], ['Mc surname street with directional', 'MCFAKE AVE NE', 'McFake Ave NE'], ['hyphenated street name', 'FAKE-SIDE RD', 'Fake-Side Rd'], ['apostrophe street name', "O'FAKE LN", "O'Fake Ln"], ['box line', 'PO BOX 14', 'PO Box 14'], ['standalone suffix', '7 FAKE ST', '7 Fake St']], [['numeric ordinal', '51ST ST', '51st St'], ['unit identifier keeps its letter', 'APT 4B', 'Apt 4B'], ['Mc surname street with directional', 'MCFAKE AVE NE', 'McFake Ave NE'], ['hyphenated street name', 'FAKE-SIDE RD', 'Fake-Side Rd'], ['apostrophe street name', "O'FAKE LN", "O'Fake Ln"], ['box line', 'PO BOX 15', 'PO Box 15'], ['standalone suffix', '8 FAKE ST', '8 Fake St']], [['numeric ordinal', '61ST ST', '61st St'], ['unit identifier keeps its letter', 'APT 5B', 'Apt 5B'], ['Mc surname street with directional', 'MCFAKE AVE NE', 'McFake Ave NE'], ['hyphenated street name', 'FAKE-SIDE RD', 'Fake-Side Rd'], ['apostrophe street name', "O'FAKE LN", "O'Fake Ln"], ['box line', 'PO BOX 16', 'PO Box 16'], ['standalone suffix', '9 FAKE ST', '9 Fake St']]]
for label, arg, expected in fixtures[N - 1]:
check(label, solve(arg), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| numeric ordinal | 21st St | 21st St | Passed |
| unit identifier keeps its letter | Apt 1B | Apt 1B | Passed |
| Mc surname street with directional | McFake Ave NE | McFake Ave NE | Passed |
| hyphenated street name | Fake-side Rd | Fake-Side Rd | Failed |
| apostrophe street name | O'Fake Ln | O'Fake Ln | Passed |
| box line | PO Box 12 | PO Box 12 | Passed |
| standalone suffix | 5 Fake St | 5 Fake St | Passed |
SHA-256 / d4fdc7dd071fb355488c2d3e344abb1d53ad0aa02400d5ecadb3d1a969d46492
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
KEEP = {'PO', 'NE', 'NW', 'SE', 'SW', 'N', 'S', 'E', 'W', 'RR', 'HC'}
def cap(p):
if p.startswith('MC') and len(p) > 2:
return 'Mc' + p[2:3] + p[3:].lower()
return p[:1] + p[1:].lower()
out = []
for w in x.split():
if w in KEEP:
out.append(w)
elif w[0].isdigit():
n = 0
while n < len(w) and w[n].isdigit():
n += 1
tail = w[n:]
out.append(w[:n] + (tail.lower() if tail in ('ST', 'ND', 'RD', 'TH') else tail))
else:
parts = ["'".join(cap(q) for q in part.split("'")) for part in w.split('-')]
out.append(' '.join(parts))
return ' '.join(out)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['numeric ordinal', '21ST ST', '21st St'], ['unit identifier keeps its letter', 'APT 1B', 'Apt 1B'], ['Mc surname street with directional', 'MCFAKE AVE NE', 'McFake Ave NE'], ['hyphenated street name', 'FAKE-SIDE RD', 'Fake-Side Rd'], ['apostrophe street name', "O'FAKE LN", "O'Fake Ln"], ['box line', 'PO BOX 12', 'PO Box 12'], ['standalone suffix', '5 FAKE ST', '5 Fake St']], [['numeric ordinal', '31ST ST', '31st St'], ['unit identifier keeps its letter', 'APT 2B', 'Apt 2B'], ['Mc surname street with directional', 'MCFAKE AVE NE', 'McFake Ave NE'], ['hyphenated street name', 'FAKE-SIDE RD', 'Fake-Side Rd'], ['apostrophe street name', "O'FAKE LN", "O'Fake Ln"], ['box line', 'PO BOX 13', 'PO Box 13'], ['standalone suffix', '6 FAKE ST', '6 Fake St']], [['numeric ordinal', '41ST ST', '41st St'], ['unit identifier keeps its letter', 'APT 3B', 'Apt 3B'], ['Mc surname street with directional', 'MCFAKE AVE NE', 'McFake Ave NE'], ['hyphenated street name', 'FAKE-SIDE RD', 'Fake-Side Rd'], ['apostrophe street name', "O'FAKE LN", "O'Fake Ln"], ['box line', 'PO BOX 14', 'PO Box 14'], ['standalone suffix', '7 FAKE ST', '7 Fake St']], [['numeric ordinal', '51ST ST', '51st St'], ['unit identifier keeps its letter', 'APT 4B', 'Apt 4B'], ['Mc surname street with directional', 'MCFAKE AVE NE', 'McFake Ave NE'], ['hyphenated street name', 'FAKE-SIDE RD', 'Fake-Side Rd'], ['apostrophe street name', "O'FAKE LN", "O'Fake Ln"], ['box line', 'PO BOX 15', 'PO Box 15'], ['standalone suffix', '8 FAKE ST', '8 Fake St']], [['numeric ordinal', '61ST ST', '61st St'], ['unit identifier keeps its letter', 'APT 5B', 'Apt 5B'], ['Mc surname street with directional', 'MCFAKE AVE NE', 'McFake Ave NE'], ['hyphenated street name', 'FAKE-SIDE RD', 'Fake-Side Rd'], ['apostrophe street name', "O'FAKE LN", "O'Fake Ln"], ['box line', 'PO BOX 16', 'PO Box 16'], ['standalone suffix', '9 FAKE ST', '9 Fake St']]]
for label, arg, expected in fixtures[N - 1]:
check(label, solve(arg), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| numeric ordinal | 21st St | 21st St | Passed |
| unit identifier keeps its letter | Apt 1B | Apt 1B | Passed |
| Mc surname street with directional | McFake Ave NE | McFake Ave NE | Passed |
| hyphenated street name | Fake Side Rd | Fake-Side Rd | Failed |
| apostrophe street name | O'Fake Ln | O'Fake Ln | Passed |
| box line | PO Box 12 | PO Box 12 | Passed |
| standalone suffix | 5 Fake St | 5 Fake St | Passed |
SHA-256 / 69abe87e18ad25bde28a66c8e0299a746f9072de78cab45eed0ed7fc621cafb3
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
A deterministic toy contract over synthetic, obviously fictitious addresses. The rules are stipulated for this model only and make no claim of conformance with any postal authority standard. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:52:21.530871+00:00.
Case digest / b4353d5a7a0dc5a68074e4cdd549a248f5ed678ef9419d1f693b3c4351524401