FA-11746 / Localization message semantics / Open access
Last-digit plural rules misclassify teen quantities · case 01
Last-digit plural rules misclassify teen quantities.
ROOT CAUSE
A final-digit lookup ignores the final-two-digit teen exclusion.
VERIFIED REPAIR
For a nonnegative integer, choose one for last digit 1 except final two digits 11; few for last digits 2..4 except final two digits 12..14; many otherwise.
Unsuccessful approach: Special-casing 11 alone leaves 12 through 14 in the few branch.
Case contract
For a nonnegative integer, choose one for last digit 1 except final two digits 11; few for last digits 2..4 except final two digits 12..14; many otherwise.
Why this case matters
This offline controlled message model isolates a localization decision; it does not implement a complete message-format or locale standard.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(n):
return 'one' if n % 10 == 1 else ('few' if n % 10 in (2,3,4) else 'many')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('one', solve(100*N+1), 'one')
check('eleven', solve(100*N+11), 'many')
check('twelve', solve(100*N+12), 'many')
check('fourteen', solve(100*N+14), 'many')
check('few', solve(100*N+4), 'few')
check('zero', solve(0), 'many')
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 |
|---|---|---|---|
| one | one | one | Passed |
| eleven | one | many | Failed |
| twelve | few | many | Failed |
| fourteen | few | many | Failed |
| few | few | few | Passed |
| zero | many | many | Passed |
SHA-256 / 8ef22b2a936e9a8b9cdcddebc109325d4979d753432e3a863ee0a2b615122bf9
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(n):
return 'many' if n % 100 == 11 else ('one' if n % 10 == 1 else ('few' if n % 10 in (2,3,4) else 'many'))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('one', solve(100*N+1), 'one')
check('eleven', solve(100*N+11), 'many')
check('twelve', solve(100*N+12), 'many')
check('fourteen', solve(100*N+14), 'many')
check('few', solve(100*N+4), 'few')
check('zero', solve(0), 'many')
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 |
|---|---|---|---|
| one | one | one | Passed |
| eleven | many | many | Passed |
| twelve | few | many | Failed |
| fourteen | few | many | Failed |
| few | few | few | Passed |
| zero | many | many | Passed |
SHA-256 / e4de8c72d0c0e6e1b165df0c5936ad7d6340a8c8553d2a1fa49e1b010b48aa41
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(n):
return 'one' if n % 10 == 1 and n % 100 != 11 else ('few' if n % 10 in (2,3,4) and n % 100 not in (12,13,14) else 'many')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('one', solve(100*N+1), 'one')
check('eleven', solve(100*N+11), 'many')
check('twelve', solve(100*N+12), 'many')
check('fourteen', solve(100*N+14), 'many')
check('few', solve(100*N+4), 'few')
check('zero', solve(0), 'many')
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 |
|---|---|---|---|
| one | one | one | Passed |
| eleven | many | many | Passed |
| twelve | many | many | Passed |
| fourteen | many | many | Passed |
| few | few | few | Passed |
| zero | many | many | Passed |
SHA-256 / d4dcddb77af84f3b4d29d0bcd7b258541b41c56964cccfec2da4882410d181de
Verification & scope
Only the explicitly specified miniature locale/message rules are modeled. 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:38:50.556503+00:00.
Case digest / 0d8e584826a2580362cf39429f5882ddc65b86f3d2d6ed498d98d214972acc76