FA-96191 / Postal address normalization / Open access
Attention and care-of line extractor: lowercase prefixes are not recognized · case 01
"attention: sam demo" stays an address line.
ROOT CAUSE
Lines are not uppercased before prefix matching.
VERIFIED REPAIR
Uppercase the whole line first.
Unsuccessful approach: Uppercasing only for the prefix test leaves the extracted name in lowercase.
Case contract
Input a list of lines. Each line is uppercased and whitespace-collapsed. The first line whose text starts with ATTENTION or ATTN, followed by end, space or colon, fills "attention"; likewise CARE OF or C/O fills "care_of"; the value is the remainder with leading spaces and colons removed. Every other line, including later duplicates, is kept in "lines".
Why this case matters
Recipient-routing lines must be separated from the delivery address before street and last-line parsing, or the attention name is parsed as a street.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
res = {'attention': '', 'care_of': '', 'lines': []}
KINDS = [('ATTENTION', 'attention'), ('ATTN', 'attention'), ('CARE OF', 'care_of'), ('C/O', 'care_of')]
for line in x:
u = ' '.join(line.split())
for prefix, kind in KINDS:
rest = u[len(prefix):]
if u.startswith(prefix) and (rest == '' or rest[0] in ' :') and not res[kind]:
res[kind] = rest.lstrip(' :')
break
else:
res['lines'].append(u)
return res
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['attention with colon', ['ATTN: Pat Example', '11 FAKE RD', 'FAKETOWN ZZ'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']}], ['care-of with runs of spaces', ['C/O FAKECO LLC', '11 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '11 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '11 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']}], ['colon without space', ['ATTN:PAT', '11 FAKE RD'], {'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']}], ['second attention line kept as address', ['ATTN PAT EXAMPLE', 'ATTN SHIPPING', '11 FAKE RD'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '11 FAKE RD']}], ['lowercase spelled attention', ['attention: pat example', '11 FAKE RD'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']}]], [['attention with colon', ['ATTN: Lee Sample', '12 FAKE RD', 'NOWHEREVILLE ZZ'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['12 FAKE RD', 'NOWHEREVILLE ZZ']}], ['care-of with runs of spaces', ['C/O FAKECO LLC', '12 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['12 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '12 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['12 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '12 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '12 FAKE RD']}], ['colon without space', ['ATTN:LEE', '12 FAKE RD'], {'attention': 'LEE', 'care_of': '', 'lines': ['12 FAKE RD']}], ['second attention line kept as address', ['ATTN LEE SAMPLE', 'ATTN SHIPPING', '12 FAKE RD'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '12 FAKE RD']}], ['lowercase spelled attention', ['attention: lee sample', '12 FAKE RD'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['12 FAKE RD']}]], [['attention with colon', ['ATTN: Robin Placeholder', '13 FAKE RD', 'ZORBLETON ZZ'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['13 FAKE RD', 'ZORBLETON ZZ']}], ['care-of with runs of spaces', ['C/O FAKECO LLC', '13 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['13 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '13 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['13 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '13 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '13 FAKE RD']}], ['colon without space', ['ATTN:ROBIN', '13 FAKE RD'], {'attention': 'ROBIN', 'care_of': '', 'lines': ['13 FAKE RD']}], ['second attention line kept as address', ['ATTN ROBIN PLACEHOLDER', 'ATTN SHIPPING', '13 FAKE RD'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['ATTN SHIPPING', '13 FAKE RD']}], ['lowercase spelled attention', ['attention: robin placeholder', '13 FAKE RD'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['13 FAKE RD']}]], [['attention with colon', ['ATTN: Sam Demo', '14 FAKE RD', 'QUILLBY ZZ'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['14 FAKE RD', 'QUILLBY ZZ']}], ['care-of with runs of spaces', ['C/O FAKECO LLC', '14 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['14 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '14 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['14 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '14 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '14 FAKE RD']}], ['colon without space', ['ATTN:SAM', '14 FAKE RD'], {'attention': 'SAM', 'care_of': '', 'lines': ['14 FAKE RD']}], ['second attention line kept as address', ['ATTN SAM DEMO', 'ATTN SHIPPING', '14 FAKE RD'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['ATTN SHIPPING', '14 FAKE RD']}], ['lowercase spelled attention', ['attention: sam demo', '14 FAKE RD'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['14 FAKE RD']}]], [['attention with colon', ['ATTN: Alex Fiction', '15 FAKE RD', 'SPRAXHAM ZZ'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['15 FAKE RD', 'SPRAXHAM ZZ']}], ['care-of with runs of spaces', ['C/O FAKECO LLC', '15 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['15 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '15 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['15 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '15 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '15 FAKE RD']}], ['colon without space', ['ATTN:ALEX', '15 FAKE RD'], {'attention': 'ALEX', 'care_of': '', 'lines': ['15 FAKE RD']}], ['second attention line kept as address', ['ATTN ALEX FICTION', 'ATTN SHIPPING', '15 FAKE RD'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['ATTN SHIPPING', '15 FAKE RD']}], ['lowercase spelled attention', ['attention: alex fiction', '15 FAKE RD'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['15 FAKE RD']}]]]
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 |
|---|---|---|---|
| attention with colon | {'attention': 'Pat Example', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']} | {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']} | Failed |
| care-of with runs of spaces | {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']} | {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']} | Passed |
| spelled care-of | {'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']} | {'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']} | Passed |
| word that merely starts with CARE OF | {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']} | {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']} | Passed |
| colon without space | {'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']} | {'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']} | Passed |
| second attention line kept as address | {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '11 FAKE RD']} | {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '11 FAKE RD']} | Passed |
| lowercase spelled attention | {'attention': '', 'care_of': '', 'lines': ['attention: pat example', '11 FAKE RD']} | {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']} | Failed |
SHA-256 / f034fd2901e32bab1631e747791897192596914915858db3c474fdd42f013eff
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
res = {'attention': '', 'care_of': '', 'lines': []}
KINDS = [('ATTENTION', 'attention'), ('ATTN', 'attention'), ('CARE OF', 'care_of'), ('C/O', 'care_of')]
for line in x:
u = ' '.join(line.split())
for prefix, kind in KINDS:
rest = u[len(prefix):]
if u.upper().startswith(prefix) and (rest == '' or rest[0] in ' :') and not res[kind]:
res[kind] = rest.lstrip(' :')
break
else:
res['lines'].append(u)
return res
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['attention with colon', ['ATTN: Pat Example', '11 FAKE RD', 'FAKETOWN ZZ'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']}], ['care-of with runs of spaces', ['C/O FAKECO LLC', '11 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '11 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '11 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']}], ['colon without space', ['ATTN:PAT', '11 FAKE RD'], {'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']}], ['second attention line kept as address', ['ATTN PAT EXAMPLE', 'ATTN SHIPPING', '11 FAKE RD'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '11 FAKE RD']}], ['lowercase spelled attention', ['attention: pat example', '11 FAKE RD'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']}]], [['attention with colon', ['ATTN: Lee Sample', '12 FAKE RD', 'NOWHEREVILLE ZZ'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['12 FAKE RD', 'NOWHEREVILLE ZZ']}], ['care-of with runs of spaces', ['C/O FAKECO LLC', '12 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['12 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '12 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['12 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '12 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '12 FAKE RD']}], ['colon without space', ['ATTN:LEE', '12 FAKE RD'], {'attention': 'LEE', 'care_of': '', 'lines': ['12 FAKE RD']}], ['second attention line kept as address', ['ATTN LEE SAMPLE', 'ATTN SHIPPING', '12 FAKE RD'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '12 FAKE RD']}], ['lowercase spelled attention', ['attention: lee sample', '12 FAKE RD'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['12 FAKE RD']}]], [['attention with colon', ['ATTN: Robin Placeholder', '13 FAKE RD', 'ZORBLETON ZZ'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['13 FAKE RD', 'ZORBLETON ZZ']}], ['care-of with runs of spaces', ['C/O FAKECO LLC', '13 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['13 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '13 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['13 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '13 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '13 FAKE RD']}], ['colon without space', ['ATTN:ROBIN', '13 FAKE RD'], {'attention': 'ROBIN', 'care_of': '', 'lines': ['13 FAKE RD']}], ['second attention line kept as address', ['ATTN ROBIN PLACEHOLDER', 'ATTN SHIPPING', '13 FAKE RD'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['ATTN SHIPPING', '13 FAKE RD']}], ['lowercase spelled attention', ['attention: robin placeholder', '13 FAKE RD'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['13 FAKE RD']}]], [['attention with colon', ['ATTN: Sam Demo', '14 FAKE RD', 'QUILLBY ZZ'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['14 FAKE RD', 'QUILLBY ZZ']}], ['care-of with runs of spaces', ['C/O FAKECO LLC', '14 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['14 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '14 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['14 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '14 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '14 FAKE RD']}], ['colon without space', ['ATTN:SAM', '14 FAKE RD'], {'attention': 'SAM', 'care_of': '', 'lines': ['14 FAKE RD']}], ['second attention line kept as address', ['ATTN SAM DEMO', 'ATTN SHIPPING', '14 FAKE RD'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['ATTN SHIPPING', '14 FAKE RD']}], ['lowercase spelled attention', ['attention: sam demo', '14 FAKE RD'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['14 FAKE RD']}]], [['attention with colon', ['ATTN: Alex Fiction', '15 FAKE RD', 'SPRAXHAM ZZ'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['15 FAKE RD', 'SPRAXHAM ZZ']}], ['care-of with runs of spaces', ['C/O FAKECO LLC', '15 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['15 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '15 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['15 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '15 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '15 FAKE RD']}], ['colon without space', ['ATTN:ALEX', '15 FAKE RD'], {'attention': 'ALEX', 'care_of': '', 'lines': ['15 FAKE RD']}], ['second attention line kept as address', ['ATTN ALEX FICTION', 'ATTN SHIPPING', '15 FAKE RD'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['ATTN SHIPPING', '15 FAKE RD']}], ['lowercase spelled attention', ['attention: alex fiction', '15 FAKE RD'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['15 FAKE RD']}]]]
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 |
|---|---|---|---|
| attention with colon | {'attention': 'Pat Example', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']} | {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']} | Failed |
| care-of with runs of spaces | {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']} | {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']} | Passed |
| spelled care-of | {'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']} | {'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']} | Passed |
| word that merely starts with CARE OF | {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']} | {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']} | Passed |
| colon without space | {'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']} | {'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']} | Passed |
| second attention line kept as address | {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '11 FAKE RD']} | {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '11 FAKE RD']} | Passed |
| lowercase spelled attention | {'attention': 'pat example', 'care_of': '', 'lines': ['11 FAKE RD']} | {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']} | Failed |
SHA-256 / 60fea842881f8e7d3d020cf5b1461b3dcd32155afccd9df8a19970bb10ba32de
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
res = {'attention': '', 'care_of': '', 'lines': []}
KINDS = [('ATTENTION', 'attention'), ('ATTN', 'attention'), ('CARE OF', 'care_of'), ('C/O', 'care_of')]
for line in x:
u = ' '.join(line.upper().split())
for prefix, kind in KINDS:
rest = u[len(prefix):]
if u.startswith(prefix) and (rest == '' or rest[0] in ' :') and not res[kind]:
res[kind] = rest.lstrip(' :')
break
else:
res['lines'].append(u)
return res
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['attention with colon', ['ATTN: Pat Example', '11 FAKE RD', 'FAKETOWN ZZ'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']}], ['care-of with runs of spaces', ['C/O FAKECO LLC', '11 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '11 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '11 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']}], ['colon without space', ['ATTN:PAT', '11 FAKE RD'], {'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']}], ['second attention line kept as address', ['ATTN PAT EXAMPLE', 'ATTN SHIPPING', '11 FAKE RD'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '11 FAKE RD']}], ['lowercase spelled attention', ['attention: pat example', '11 FAKE RD'], {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']}]], [['attention with colon', ['ATTN: Lee Sample', '12 FAKE RD', 'NOWHEREVILLE ZZ'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['12 FAKE RD', 'NOWHEREVILLE ZZ']}], ['care-of with runs of spaces', ['C/O FAKECO LLC', '12 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['12 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '12 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['12 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '12 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '12 FAKE RD']}], ['colon without space', ['ATTN:LEE', '12 FAKE RD'], {'attention': 'LEE', 'care_of': '', 'lines': ['12 FAKE RD']}], ['second attention line kept as address', ['ATTN LEE SAMPLE', 'ATTN SHIPPING', '12 FAKE RD'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '12 FAKE RD']}], ['lowercase spelled attention', ['attention: lee sample', '12 FAKE RD'], {'attention': 'LEE SAMPLE', 'care_of': '', 'lines': ['12 FAKE RD']}]], [['attention with colon', ['ATTN: Robin Placeholder', '13 FAKE RD', 'ZORBLETON ZZ'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['13 FAKE RD', 'ZORBLETON ZZ']}], ['care-of with runs of spaces', ['C/O FAKECO LLC', '13 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['13 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '13 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['13 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '13 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '13 FAKE RD']}], ['colon without space', ['ATTN:ROBIN', '13 FAKE RD'], {'attention': 'ROBIN', 'care_of': '', 'lines': ['13 FAKE RD']}], ['second attention line kept as address', ['ATTN ROBIN PLACEHOLDER', 'ATTN SHIPPING', '13 FAKE RD'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['ATTN SHIPPING', '13 FAKE RD']}], ['lowercase spelled attention', ['attention: robin placeholder', '13 FAKE RD'], {'attention': 'ROBIN PLACEHOLDER', 'care_of': '', 'lines': ['13 FAKE RD']}]], [['attention with colon', ['ATTN: Sam Demo', '14 FAKE RD', 'QUILLBY ZZ'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['14 FAKE RD', 'QUILLBY ZZ']}], ['care-of with runs of spaces', ['C/O FAKECO LLC', '14 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['14 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '14 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['14 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '14 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '14 FAKE RD']}], ['colon without space', ['ATTN:SAM', '14 FAKE RD'], {'attention': 'SAM', 'care_of': '', 'lines': ['14 FAKE RD']}], ['second attention line kept as address', ['ATTN SAM DEMO', 'ATTN SHIPPING', '14 FAKE RD'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['ATTN SHIPPING', '14 FAKE RD']}], ['lowercase spelled attention', ['attention: sam demo', '14 FAKE RD'], {'attention': 'SAM DEMO', 'care_of': '', 'lines': ['14 FAKE RD']}]], [['attention with colon', ['ATTN: Alex Fiction', '15 FAKE RD', 'SPRAXHAM ZZ'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['15 FAKE RD', 'SPRAXHAM ZZ']}], ['care-of with runs of spaces', ['C/O FAKECO LLC', '15 FAKE RD'], {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['15 FAKE RD']}], ['spelled care-of', ['CARE OF FAKECO', '15 FAKE RD'], {'attention': '', 'care_of': 'FAKECO', 'lines': ['15 FAKE RD']}], ['word that merely starts with CARE OF', ['CARE OFFICE PARK', '15 FAKE RD'], {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '15 FAKE RD']}], ['colon without space', ['ATTN:ALEX', '15 FAKE RD'], {'attention': 'ALEX', 'care_of': '', 'lines': ['15 FAKE RD']}], ['second attention line kept as address', ['ATTN ALEX FICTION', 'ATTN SHIPPING', '15 FAKE RD'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['ATTN SHIPPING', '15 FAKE RD']}], ['lowercase spelled attention', ['attention: alex fiction', '15 FAKE RD'], {'attention': 'ALEX FICTION', 'care_of': '', 'lines': ['15 FAKE RD']}]]]
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 |
|---|---|---|---|
| attention with colon | {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']} | {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD', 'FAKETOWN ZZ']} | Passed |
| care-of with runs of spaces | {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']} | {'attention': '', 'care_of': 'FAKECO LLC', 'lines': ['11 FAKE RD']} | Passed |
| spelled care-of | {'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']} | {'attention': '', 'care_of': 'FAKECO', 'lines': ['11 FAKE RD']} | Passed |
| word that merely starts with CARE OF | {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']} | {'attention': '', 'care_of': '', 'lines': ['CARE OFFICE PARK', '11 FAKE RD']} | Passed |
| colon without space | {'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']} | {'attention': 'PAT', 'care_of': '', 'lines': ['11 FAKE RD']} | Passed |
| second attention line kept as address | {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '11 FAKE RD']} | {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['ATTN SHIPPING', '11 FAKE RD']} | Passed |
| lowercase spelled attention | {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']} | {'attention': 'PAT EXAMPLE', 'care_of': '', 'lines': ['11 FAKE RD']} | Passed |
SHA-256 / 456fbf26b7a892996faaaa66cf602435b3e3972b240b55965ba2d4563ed7c8de
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:20.596734+00:00.
Case digest / 95e53eadfb81c9c029abe2b88053f48cc374e27647632ff9d1f9df088573f247