FAILURE MAP
← Case archive

FA-80281 / Typography line breaking / Open access

Single-letter and unit bindings: decimal number detection · case 01

Decimal quantities like 2.5 or 1,5 are split from their units.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Only pure digit strings are recognised as numbers.

VERIFIED REPAIR

Strip one decimal separator before testing for digits.

Unsuccessful approach: Stripping only the period still misses decimal commas.

Case contract

Input [words, width]. A single-letter preposition/conjunction (a i o u v z k s w, any case) is bound to the following word, chaining; a number (digits with optional . or , decimal) is bound to a following unit (kg km cm mm % pt px). Bound groups are unbreakable; greedy fill of groups with unit spaces; an overwide group is set alone. Return lines.

Why this case matters

Line breaking decides where paragraphs wrap on screen and in print; a wrong decision point shifts every following line.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    words, width = x
    SINGLE = {'a', 'i', 'o', 'u', 'v', 'z', 'k', 's', 'w'}
    UNITS = {'kg', 'km', 'cm', 'mm', '%', 'pt', 'px'}
    groups = []
    k = 0
    while k < len(words):
        grp = [words[k]]
        while True:
            last = grp[-1]
            nxt = k + len(grp)
            if nxt >= len(words):
                break
            number = last.isdigit()
            if last.lower() in SINGLE or (number and words[nxt] in UNITS):
                grp.append(words[nxt])
            else:
                break
        groups.append(' '.join(grp))
        k += len(grp)
    lines, cur = [], ''
    for g in groups:
        cand = g if not cur else cur + ' ' + g
        if len(cand) <= width or not cur:
            cur = cand
        else:
            lines.append(cur)
            cur = g
    if cur:
        lines.append(cur)
    return lines
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('regression: decimal number detection', [['text', 's', 'sazba', 'i', 'i', 'text', 'pt', '1,5', 'km', 'domě', 'i'], 16], ['text s sazba', 'i i text pt', '1,5 km domě i']), ('regression: decimal number detection', [['z', 'text', 'domě', '1,5', 'kg', 'cm', 'cm', '10', 'o', 'kg', 'pt'], 16], ['z text domě', '1,5 kg cm cm 10', 'o kg pt']), ('regression: decimal number detection', [['v', 'Praze', 'Praze', 'v', '1,5', 'cm', 'k', 'V', '10'], 12], ['v Praze', 'Praze', 'v 1,5 cm', 'k V 10']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['kg', 'km', 's', '2.5', 'z', 'i', 'pt'], 6], ['kg km', 's 2.5', 'z i pt']), ('control layout', [['a', 'a', 's', 'V', 'sazba', 'z'], 8], ['a a s V sazba', 'z'])], [('regression: decimal number detection', [['z', 'domě', 's', 'V', 's', 's', 's', 'k', '2.5', 'cm', '10', 'k'], 8], ['z domě', 's V s s s k 2.5 cm', '10 k']), ('regression: decimal number detection', [['o', 'i', 'k', 'V', 'text', 'kg', '2.5', 'kg', 'cm'], 7], ['o i k V text', 'kg', '2.5 kg', 'cm']), ('regression: decimal number detection', [['pt', 'cm', 'z', 'km', 'domě', '1,5', 'km', 'pt', 'v', 'v', '1,5', 'z'], 10], ['pt cm z km', 'domě', '1,5 km pt', 'v v 1,5 z']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['sazba', 'V', '1,5', 's', 'z'], 8], ['sazba', 'V 1,5', 's z']), ('control layout', [['řádek', 'pt', 'v', 's', 'V', 'pt', 'v'], 14], ['řádek pt', 'v s V pt v'])], [('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('regression: decimal number detection', [['text', '1,5', 'V', 'k', 'sazba', '1,5', 'km', 'text', 'i'], 15], ['text 1,5', 'V k sazba', '1,5 km text i']), ('regression: decimal number detection', [['text', 's', 'sazba', 'i', 'i', 'text', 'pt', '1,5', 'km', 'domě', 'i'], 16], ['text s sazba', 'i i text pt', '1,5 km domě i']), ('regression: decimal number detection', [['v', 'Praze', 'Praze', 'v', '1,5', 'cm', 'k', 'V', '10'], 12], ['v Praze', 'Praze', 'v 1,5 cm', 'k V 10']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['V', 'V', 'Praze', 'řádek', '2.5', 'domě'], 13], ['V V Praze', 'řádek 2.5', 'domě']), ('control layout', [['s', 'text', 'a', 'text', 'sazba', '10', 'v', 'text', '10', '10'], 6], ['s text', 'a text', 'sazba', '10', 'v text', '10 10'])], [('regression: decimal number detection', [['text', '1,5', 'V', 'k', 'sazba', '1,5', 'km', 'text', 'i'], 15], ['text 1,5', 'V k sazba', '1,5 km text i']), ('regression: decimal number detection', [['i', '2.5', 'pt', 'o', '1,5', 'o', 'i', 'V', 'pt', 'text', '2.5', 'km'], 7], ['i 2.5 pt', 'o 1,5', 'o i V pt', 'text', '2.5 km']), ('regression: decimal number detection', [['pt', 'cm', 'z', 'km', 'domě', '1,5', 'km', 'pt', 'v', 'v', '1,5', 'z'], 10], ['pt cm z km', 'domě', '1,5 km pt', 'v v 1,5 z']), ('regression: decimal number detection', [['text', 's', 'sazba', 'i', 'i', 'text', 'pt', '1,5', 'km', 'domě', 'i'], 16], ['text s sazba', 'i i text pt', '1,5 km domě i']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['v', 's', 'k', 'domě', 'k', 'k'], 6], ['v s k domě', 'k k']), ('control layout', [['s', 'text', 'a', 'text', 'sazba', '10', 'v', 'text', '10', '10'], 6], ['s text', 'a text', 'sazba', '10', 'v text', '10 10'])], [('regression: decimal number detection', [['o', 'i', 'k', 'V', 'text', 'kg', '2.5', 'kg', 'cm'], 7], ['o i k V text', 'kg', '2.5 kg', 'cm']), ('regression: decimal number detection', [['o', 'a', 's', 's', '1,5', 'cm', 'pt'], 7], ['o a s s 1,5 cm', 'pt']), ('regression: decimal number detection', [['text', 's', 'sazba', 'i', 'i', 'text', 'pt', '1,5', 'km', 'domě', 'i'], 16], ['text s sazba', 'i i text pt', '1,5 km domě i']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('control layout', [['V', '1,5', 'pt', '1,5', 'z', 'o', 'i'], 11], ['V 1,5 pt', '1,5 z o i']), ('control layout', [['1,5', 'km', 'domě', 'sazba', 'kg', 'V', 'v', 'text', 'domě', '1,5'], 11], ['1,5 km domě', 'sazba kg', 'V v text', 'domě 1,5'])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(args), 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 fixtureActualExpectedOutcome
decimal comma with unit['sazba 1,5', 'cm text']['sazba', '1,5 cm', 'text']Failed
regression: decimal number detection['text s sazba', 'i i text pt 1,5', 'km domě i']['text s sazba', 'i i text pt', '1,5 km domě i']Failed
regression: decimal number detection['z text domě 1,5', 'kg cm cm 10 o kg', 'pt']['z text domě', '1,5 kg cm cm 10', 'o kg pt']Failed
regression: decimal number detection['v Praze', 'Praze v 1,5', 'cm k V 10']['v Praze', 'Praze', 'v 1,5 cm', 'k V 10']Failed
chained singles['text', 'v a k domě']['text', 'v a k domě']Passed
sentence-initial V binds['V Praze', 'text', 'sazba']['V Praze', 'text', 'sazba']Passed
control layout['kg km', 's 2.5', 'z i pt']['kg km', 's 2.5', 'z i pt']Passed
control layout['a a s V sazba', 'z']['a a s V sazba', 'z']Passed

SHA-256 / 5948001fa100f971ba0b13ba0c281c9b74206c831573a60a280b0755ab26c60a

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    words, width = x
    SINGLE = {'a', 'i', 'o', 'u', 'v', 'z', 'k', 's', 'w'}
    UNITS = {'kg', 'km', 'cm', 'mm', '%', 'pt', 'px'}
    groups = []
    k = 0
    while k < len(words):
        grp = [words[k]]
        while True:
            last = grp[-1]
            nxt = k + len(grp)
            if nxt >= len(words):
                break
            number = last.replace('.', '').isdigit()
            if last.lower() in SINGLE or (number and words[nxt] in UNITS):
                grp.append(words[nxt])
            else:
                break
        groups.append(' '.join(grp))
        k += len(grp)
    lines, cur = [], ''
    for g in groups:
        cand = g if not cur else cur + ' ' + g
        if len(cand) <= width or not cur:
            cur = cand
        else:
            lines.append(cur)
            cur = g
    if cur:
        lines.append(cur)
    return lines
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('regression: decimal number detection', [['text', 's', 'sazba', 'i', 'i', 'text', 'pt', '1,5', 'km', 'domě', 'i'], 16], ['text s sazba', 'i i text pt', '1,5 km domě i']), ('regression: decimal number detection', [['z', 'text', 'domě', '1,5', 'kg', 'cm', 'cm', '10', 'o', 'kg', 'pt'], 16], ['z text domě', '1,5 kg cm cm 10', 'o kg pt']), ('regression: decimal number detection', [['v', 'Praze', 'Praze', 'v', '1,5', 'cm', 'k', 'V', '10'], 12], ['v Praze', 'Praze', 'v 1,5 cm', 'k V 10']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['kg', 'km', 's', '2.5', 'z', 'i', 'pt'], 6], ['kg km', 's 2.5', 'z i pt']), ('control layout', [['a', 'a', 's', 'V', 'sazba', 'z'], 8], ['a a s V sazba', 'z'])], [('regression: decimal number detection', [['z', 'domě', 's', 'V', 's', 's', 's', 'k', '2.5', 'cm', '10', 'k'], 8], ['z domě', 's V s s s k 2.5 cm', '10 k']), ('regression: decimal number detection', [['o', 'i', 'k', 'V', 'text', 'kg', '2.5', 'kg', 'cm'], 7], ['o i k V text', 'kg', '2.5 kg', 'cm']), ('regression: decimal number detection', [['pt', 'cm', 'z', 'km', 'domě', '1,5', 'km', 'pt', 'v', 'v', '1,5', 'z'], 10], ['pt cm z km', 'domě', '1,5 km pt', 'v v 1,5 z']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['sazba', 'V', '1,5', 's', 'z'], 8], ['sazba', 'V 1,5', 's z']), ('control layout', [['řádek', 'pt', 'v', 's', 'V', 'pt', 'v'], 14], ['řádek pt', 'v s V pt v'])], [('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('regression: decimal number detection', [['text', '1,5', 'V', 'k', 'sazba', '1,5', 'km', 'text', 'i'], 15], ['text 1,5', 'V k sazba', '1,5 km text i']), ('regression: decimal number detection', [['text', 's', 'sazba', 'i', 'i', 'text', 'pt', '1,5', 'km', 'domě', 'i'], 16], ['text s sazba', 'i i text pt', '1,5 km domě i']), ('regression: decimal number detection', [['v', 'Praze', 'Praze', 'v', '1,5', 'cm', 'k', 'V', '10'], 12], ['v Praze', 'Praze', 'v 1,5 cm', 'k V 10']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['V', 'V', 'Praze', 'řádek', '2.5', 'domě'], 13], ['V V Praze', 'řádek 2.5', 'domě']), ('control layout', [['s', 'text', 'a', 'text', 'sazba', '10', 'v', 'text', '10', '10'], 6], ['s text', 'a text', 'sazba', '10', 'v text', '10 10'])], [('regression: decimal number detection', [['text', '1,5', 'V', 'k', 'sazba', '1,5', 'km', 'text', 'i'], 15], ['text 1,5', 'V k sazba', '1,5 km text i']), ('regression: decimal number detection', [['i', '2.5', 'pt', 'o', '1,5', 'o', 'i', 'V', 'pt', 'text', '2.5', 'km'], 7], ['i 2.5 pt', 'o 1,5', 'o i V pt', 'text', '2.5 km']), ('regression: decimal number detection', [['pt', 'cm', 'z', 'km', 'domě', '1,5', 'km', 'pt', 'v', 'v', '1,5', 'z'], 10], ['pt cm z km', 'domě', '1,5 km pt', 'v v 1,5 z']), ('regression: decimal number detection', [['text', 's', 'sazba', 'i', 'i', 'text', 'pt', '1,5', 'km', 'domě', 'i'], 16], ['text s sazba', 'i i text pt', '1,5 km domě i']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['v', 's', 'k', 'domě', 'k', 'k'], 6], ['v s k domě', 'k k']), ('control layout', [['s', 'text', 'a', 'text', 'sazba', '10', 'v', 'text', '10', '10'], 6], ['s text', 'a text', 'sazba', '10', 'v text', '10 10'])], [('regression: decimal number detection', [['o', 'i', 'k', 'V', 'text', 'kg', '2.5', 'kg', 'cm'], 7], ['o i k V text', 'kg', '2.5 kg', 'cm']), ('regression: decimal number detection', [['o', 'a', 's', 's', '1,5', 'cm', 'pt'], 7], ['o a s s 1,5 cm', 'pt']), ('regression: decimal number detection', [['text', 's', 'sazba', 'i', 'i', 'text', 'pt', '1,5', 'km', 'domě', 'i'], 16], ['text s sazba', 'i i text pt', '1,5 km domě i']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('control layout', [['V', '1,5', 'pt', '1,5', 'z', 'o', 'i'], 11], ['V 1,5 pt', '1,5 z o i']), ('control layout', [['1,5', 'km', 'domě', 'sazba', 'kg', 'V', 'v', 'text', 'domě', '1,5'], 11], ['1,5 km domě', 'sazba kg', 'V v text', 'domě 1,5'])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(args), 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 fixtureActualExpectedOutcome
decimal comma with unit['sazba 1,5', 'cm text']['sazba', '1,5 cm', 'text']Failed
regression: decimal number detection['text s sazba', 'i i text pt 1,5', 'km domě i']['text s sazba', 'i i text pt', '1,5 km domě i']Failed
regression: decimal number detection['z text domě 1,5', 'kg cm cm 10 o kg', 'pt']['z text domě', '1,5 kg cm cm 10', 'o kg pt']Failed
regression: decimal number detection['v Praze', 'Praze v 1,5', 'cm k V 10']['v Praze', 'Praze', 'v 1,5 cm', 'k V 10']Failed
chained singles['text', 'v a k domě']['text', 'v a k domě']Passed
sentence-initial V binds['V Praze', 'text', 'sazba']['V Praze', 'text', 'sazba']Passed
control layout['kg km', 's 2.5', 'z i pt']['kg km', 's 2.5', 'z i pt']Passed
control layout['a a s V sazba', 'z']['a a s V sazba', 'z']Passed

SHA-256 / cdffb3460e92cae44d61454546fc3c11a00aa29904f81dccee2277b5064448ea

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    words, width = x
    SINGLE = {'a', 'i', 'o', 'u', 'v', 'z', 'k', 's', 'w'}
    UNITS = {'kg', 'km', 'cm', 'mm', '%', 'pt', 'px'}
    groups = []
    k = 0
    while k < len(words):
        grp = [words[k]]
        while True:
            last = grp[-1]
            nxt = k + len(grp)
            if nxt >= len(words):
                break
            number = last.replace('.', '').replace(',', '').isdigit()
            if last.lower() in SINGLE or (number and words[nxt] in UNITS):
                grp.append(words[nxt])
            else:
                break
        groups.append(' '.join(grp))
        k += len(grp)
    lines, cur = [], ''
    for g in groups:
        cand = g if not cur else cur + ' ' + g
        if len(cand) <= width or not cur:
            cur = cand
        else:
            lines.append(cur)
            cur = g
    if cur:
        lines.append(cur)
    return lines
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('regression: decimal number detection', [['text', 's', 'sazba', 'i', 'i', 'text', 'pt', '1,5', 'km', 'domě', 'i'], 16], ['text s sazba', 'i i text pt', '1,5 km domě i']), ('regression: decimal number detection', [['z', 'text', 'domě', '1,5', 'kg', 'cm', 'cm', '10', 'o', 'kg', 'pt'], 16], ['z text domě', '1,5 kg cm cm 10', 'o kg pt']), ('regression: decimal number detection', [['v', 'Praze', 'Praze', 'v', '1,5', 'cm', 'k', 'V', '10'], 12], ['v Praze', 'Praze', 'v 1,5 cm', 'k V 10']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['kg', 'km', 's', '2.5', 'z', 'i', 'pt'], 6], ['kg km', 's 2.5', 'z i pt']), ('control layout', [['a', 'a', 's', 'V', 'sazba', 'z'], 8], ['a a s V sazba', 'z'])], [('regression: decimal number detection', [['z', 'domě', 's', 'V', 's', 's', 's', 'k', '2.5', 'cm', '10', 'k'], 8], ['z domě', 's V s s s k 2.5 cm', '10 k']), ('regression: decimal number detection', [['o', 'i', 'k', 'V', 'text', 'kg', '2.5', 'kg', 'cm'], 7], ['o i k V text', 'kg', '2.5 kg', 'cm']), ('regression: decimal number detection', [['pt', 'cm', 'z', 'km', 'domě', '1,5', 'km', 'pt', 'v', 'v', '1,5', 'z'], 10], ['pt cm z km', 'domě', '1,5 km pt', 'v v 1,5 z']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['sazba', 'V', '1,5', 's', 'z'], 8], ['sazba', 'V 1,5', 's z']), ('control layout', [['řádek', 'pt', 'v', 's', 'V', 'pt', 'v'], 14], ['řádek pt', 'v s V pt v'])], [('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('regression: decimal number detection', [['text', '1,5', 'V', 'k', 'sazba', '1,5', 'km', 'text', 'i'], 15], ['text 1,5', 'V k sazba', '1,5 km text i']), ('regression: decimal number detection', [['text', 's', 'sazba', 'i', 'i', 'text', 'pt', '1,5', 'km', 'domě', 'i'], 16], ['text s sazba', 'i i text pt', '1,5 km domě i']), ('regression: decimal number detection', [['v', 'Praze', 'Praze', 'v', '1,5', 'cm', 'k', 'V', '10'], 12], ['v Praze', 'Praze', 'v 1,5 cm', 'k V 10']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['V', 'V', 'Praze', 'řádek', '2.5', 'domě'], 13], ['V V Praze', 'řádek 2.5', 'domě']), ('control layout', [['s', 'text', 'a', 'text', 'sazba', '10', 'v', 'text', '10', '10'], 6], ['s text', 'a text', 'sazba', '10', 'v text', '10 10'])], [('regression: decimal number detection', [['text', '1,5', 'V', 'k', 'sazba', '1,5', 'km', 'text', 'i'], 15], ['text 1,5', 'V k sazba', '1,5 km text i']), ('regression: decimal number detection', [['i', '2.5', 'pt', 'o', '1,5', 'o', 'i', 'V', 'pt', 'text', '2.5', 'km'], 7], ['i 2.5 pt', 'o 1,5', 'o i V pt', 'text', '2.5 km']), ('regression: decimal number detection', [['pt', 'cm', 'z', 'km', 'domě', '1,5', 'km', 'pt', 'v', 'v', '1,5', 'z'], 10], ['pt cm z km', 'domě', '1,5 km pt', 'v v 1,5 z']), ('regression: decimal number detection', [['text', 's', 'sazba', 'i', 'i', 'text', 'pt', '1,5', 'km', 'domě', 'i'], 16], ['text s sazba', 'i i text pt', '1,5 km domě i']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['v', 's', 'k', 'domě', 'k', 'k'], 6], ['v s k domě', 'k k']), ('control layout', [['s', 'text', 'a', 'text', 'sazba', '10', 'v', 'text', '10', '10'], 6], ['s text', 'a text', 'sazba', '10', 'v text', '10 10'])], [('regression: decimal number detection', [['o', 'i', 'k', 'V', 'text', 'kg', '2.5', 'kg', 'cm'], 7], ['o i k V text', 'kg', '2.5 kg', 'cm']), ('regression: decimal number detection', [['o', 'a', 's', 's', '1,5', 'cm', 'pt'], 7], ['o a s s 1,5 cm', 'pt']), ('regression: decimal number detection', [['text', 's', 'sazba', 'i', 'i', 'text', 'pt', '1,5', 'km', 'domě', 'i'], 16], ['text s sazba', 'i i text pt', '1,5 km domě i']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('control layout', [['V', '1,5', 'pt', '1,5', 'z', 'o', 'i'], 11], ['V 1,5 pt', '1,5 z o i']), ('control layout', [['1,5', 'km', 'domě', 'sazba', 'kg', 'V', 'v', 'text', 'domě', '1,5'], 11], ['1,5 km domě', 'sazba kg', 'V v text', 'domě 1,5'])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(args), 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 fixtureActualExpectedOutcome
decimal comma with unit['sazba', '1,5 cm', 'text']['sazba', '1,5 cm', 'text']Passed
regression: decimal number detection['text s sazba', 'i i text pt', '1,5 km domě i']['text s sazba', 'i i text pt', '1,5 km domě i']Passed
regression: decimal number detection['z text domě', '1,5 kg cm cm 10', 'o kg pt']['z text domě', '1,5 kg cm cm 10', 'o kg pt']Passed
regression: decimal number detection['v Praze', 'Praze', 'v 1,5 cm', 'k V 10']['v Praze', 'Praze', 'v 1,5 cm', 'k V 10']Passed
chained singles['text', 'v a k domě']['text', 'v a k domě']Passed
sentence-initial V binds['V Praze', 'text', 'sazba']['V Praze', 'text', 'sazba']Passed
control layout['kg km', 's 2.5', 'z i pt']['kg km', 's 2.5', 'z i pt']Passed
control layout['a a s V sazba', 'z']['a a s V sazba', 'z']Passed

SHA-256 / 70b062463261e2ffdc64b7a1424f4d060f8afa96f020a38de52cadd668c0f70d

Verification & scope

A deterministic toy typesetting model with integer widths and a stipulated rule set; it does not claim conformance to any engine. 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:49:52.291134+00:00.

Case digest / 84c56497a7ce2612c30bb545ff15b1ddeacf3da0a153add39cdf97c3e801609e