{"abstract":"The paragraph's last word is split across lines.","category":"Typography line breaking","checks":8,"contract":"Input [words as syllable lists, width, limit]. Greedy fill with 1-unit spaces and characters. A word that does not fit may be split at the latest syllable boundary whose head plus \"-\" fits, only if fewer than limit immediately preceding lines ended in a hyphen and the word is not the paragraph's last word. A line ended without hyphen resets the streak; a word too long for an empty line is set alone. Return the lines.","evaluation_group":"w2-typography-line-breaking-hyphen-ladder","failed_approach":"Guarding the last two words protects a word that may legally split.","family":"w2-typography-line-breaking-hyphen-ladder-final-word-protection","id":"FA-79961","implementations":{"attempt":{"sha256":"5e4f84323e933ceeac7ef8e682cbe803166c09c9dec46a63f0ff72ac99908f67","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    words, width, limit = x\n    queue = [list(w) for w in words]\n    lines = []\n    cur = ''\n    streak = 0\n    k = 0\n    while k < len(queue):\n        syl = queue[k]\n        token = ''.join(syl)\n        need = len(token) if cur == '' else len(cur) + 1 + len(token)\n        if need <= width:\n            cur = token if cur == '' else cur + ' ' + token\n            k += 1\n            continue\n        split = None\n        if streak < limit and k < len(queue) - 2:\n            for cut in range(len(syl) - 1, 0, -1):\n                head = ''.join(syl[:cut]) + '-'\n                room = len(head) if cur == '' else len(cur) + len(head) + 1\n                if room <= width:\n                    split = cut\n                    break\n        if split is not None:\n            head = ''.join(syl[:split]) + '-'\n            lines.append(head if cur == '' else cur + ' ' + head)\n            queue[k] = syl[split:]\n            cur = ''\n            streak += 1\n        elif cur == '':\n            lines.append(token)\n            k += 1\n            streak = 0\n        else:\n            lines.append(cur)\n            cur, streak = '', 0\n    if cur:\n        lines.append(cur)\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('regression: final word protection', [[['to'], ['in', 'ter', 'na', 'tion', 'al'], ['a'], ['mar', 'gin'], ['a'], ['text'], ['a'], ['break', 'ing']], 7, 3], ['to in-', 'terna-', 'tional', 'a mar-', 'gin a', 'text a', 'breaking']), ('partial-repair probe', [[['text'], ['jus', 'ti', 'fied'], ['a'], ['hy', 'phen', 'a', 'tion'], ['set', 'ting'], ['line'], ['line'], ['jus', 'ti', 'fied'], ['col', 'umn'], ['jus', 'ti', 'fied'], ['com', 'po', 'si', 'tion']], 11, 1], ['text justi-', 'fied a', 'hyphenation', 'setting', 'line line', 'justified', 'column jus-', 'tified', 'composition']), ('regression: final word protection', [[['line'], ['pa', 'ra', 'graph'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing']], 6, 1], ['line', 'para-', 'graph', 'compo-', 'sition', 'hy-', 'phenation', 'para-', 'graph', 'inter-', 'national', 'kerning']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['kern', 'ing'], ['line'], ['type'], ['jus', 'ti', 'fied'], ['set', 'ting']], 11, 2], ['kerning', 'line type', 'justified', 'setting']), ('control layout', [[['hy', 'phen', 'a', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting'], ['set', 'ting'], ['a']], 10, 2], ['hyphena-', 'tion in-', 'ternational', 'setting', 'setting a']), ('control layout', [[['col', 'umn'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['type'], ['of'], ['of'], ['line'], ['set', 'ting'], ['pa', 'ra', 'graph'], ['kern', 'ing'], ['line']], 7, 3], ['column', 'compo-', 'sition', 'hyphen-', 'ation', 'leading', 'type of', 'of line', 'setting', 'para-', 'graph', 'kerning', 'line'])], [('regression: final word protection', [[['break', 'ing'], ['mar', 'gin'], ['hy', 'phen', 'a', 'tion'], ['jus', 'ti', 'fied'], ['a'], ['hy', 'phen', 'a', 'tion'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion']], 10, 3], ['breaking', 'margin hy-', 'phenation', 'justified', 'a hyphena-', 'tion com-', 'position', 'hyphenation']), ('regression: final word protection', [[['pa', 'ra', 'graph'], ['break', 'ing'], ['mar', 'gin'], ['hy', 'phen', 'a', 'tion'], ['kern', 'ing'], ['jus', 'ti', 'fied'], ['to'], ['kern', 'ing'], ['hy', 'phen', 'a', 'tion']], 12, 1], ['paragraph', 'breaking', 'margin hy-', 'phenation', 'kerning jus-', 'tified to', 'kerning', 'hyphenation']), ('partial-repair probe', [[['break', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['text'], ['of'], ['set', 'ting'], ['in', 'ter', 'na', 'tion', 'al'], ['line'], ['a'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting']], 9, 3], ['breaking', 'interna-', 'tional', 'text of', 'setting', 'interna-', 'tional', 'line a', 'interna-', 'tional', 'setting']), ('regression: final word protection', [[['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin'], ['break', 'ing'], ['mar', 'gin'], ['line'], ['set', 'ting'], ['in', 'ter', 'na', 'tion', 'al']], 6, 1], ['compo-', 'sition', 'inter-', 'national', 'margin', 'break-', 'ing', 'margin', 'line', 'set-', 'ting', 'international']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['set', 'ting'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['type'], ['type'], ['text'], ['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['a'], ['set', 'ting']], 11, 2], ['setting', 'justified', 'breaking', 'type type', 'text break-', 'ing hyphen-', 'ation a', 'setting']), ('control layout', [[['a'], ['line'], ['lead', 'ing'], ['break', 'ing'], ['text'], ['of'], ['com', 'po', 'si', 'tion'], ['to'], ['hy', 'phen', 'a', 'tion'], ['to'], ['type']], 6, 2], ['a line', 'lead-', 'ing', 'break-', 'ing', 'text', 'of', 'compo-', 'sition', 'to hy-', 'phena-', 'tion', 'to', 'type'])], [('regression: final word protection', [[['set', 'ting'], ['of'], ['mar', 'gin'], ['kern', 'ing'], ['set', 'ting'], ['col', 'umn'], ['line'], ['set', 'ting'], ['a'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin']], 11, 2], ['setting of', 'margin', 'kerning', 'setting', 'column line', 'setting a', 'interna-', 'tional', 'margin']), ('regression: final word protection', [[['a'], ['type'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['to'], ['to'], ['break', 'ing'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['type'], ['text'], ['hy', 'phen', 'a', 'tion']], 10, 3], ['a type in-', 'ternation-', 'al leading', 'to to', 'breaking', 'composi-', 'tion hy-', 'phenation', 'type text', 'hyphenation']), ('regression: final word protection', [[['text'], ['line'], ['to'], ['text'], ['lead', 'ing'], ['jus', 'ti', 'fied'], ['set', 'ting'], ['jus', 'ti', 'fied'], ['of'], ['break', 'ing'], ['com', 'po', 'si', 'tion']], 10, 3], ['text line', 'to text', 'leading', 'justified', 'setting', 'justified', 'of break-', 'ing', 'composition']), ('regression: final word protection', [[['break', 'ing'], ['of'], ['set', 'ting'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al']], 9, 3], ['breaking', 'of set-', 'ting mar-', 'gin', 'international']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('control layout', [[['kern', 'ing'], ['set', 'ting'], ['col', 'umn'], ['of'], ['text']], 7, 3], ['kerning', 'setting', 'column', 'of text']), ('control layout', [[['line'], ['in', 'ter', 'na', 'tion', 'al'], ['pa', 'ra', 'graph'], ['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['mar', 'gin'], ['to'], ['set', 'ting'], ['text'], ['mar', 'gin'], ['kern', 'ing'], ['jus', 'ti', 'fied']], 14, 1], ['line interna-', 'tional', 'paragraph in-', 'ternational', 'composition', 'margin to set-', 'ting text', 'margin kerning', 'justified'])], [('regression: final word protection', [[['line'], ['pa', 'ra', 'graph'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing']], 6, 1], ['line', 'para-', 'graph', 'compo-', 'sition', 'hy-', 'phenation', 'para-', 'graph', 'inter-', 'national', 'kerning']), ('regression: final word protection', [[['a'], ['break', 'ing'], ['text'], ['to'], ['mar', 'gin'], ['set', 'ting'], ['in', 'ter', 'na', 'tion', 'al'], ['in', 'ter', 'na', 'tion', 'al']], 6, 3], ['a', 'break-', 'ing', 'text', 'to', 'margin', 'set-', 'ting', 'inter-', 'na-', 'tional', 'international']), ('partial-repair probe', [[['jus', 'ti', 'fied'], ['break', 'ing'], ['to'], ['hy', 'phen', 'a', 'tion'], ['col', 'umn']], 9, 3], ['justified', 'breaking', 'to hy-', 'phenation', 'column']), ('regression: final word protection', [[['break', 'ing'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['break', 'ing'], ['text'], ['set', 'ting'], ['lead', 'ing']], 11, 3], ['breaking', 'composition', 'interna-', 'tional', 'breaking', 'text set-', 'ting', 'leading']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['mar', 'gin'], ['text'], ['lead', 'ing'], ['col', 'umn'], ['hy', 'phen', 'a', 'tion'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin'], ['set', 'ting'], ['to'], ['jus', 'ti', 'fied'], ['lead', 'ing']], 13, 1], ['margin text', 'leading col-', 'umn', 'hyphenation', 'margin inter-', 'national', 'margin set-', 'ting to', 'justified', 'leading']), ('control layout', [[['to'], ['set', 'ting'], ['of'], ['lead', 'ing'], ['lead', 'ing'], ['of'], ['com', 'po', 'si', 'tion'], ['set', 'ting'], ['lead', 'ing']], 12, 2], ['to setting', 'of leading', 'leading of', 'composition', 'setting', 'leading'])], [('regression: final word protection', [[['hy', 'phen', 'a', 'tion'], ['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['break', 'ing'], ['of'], ['text'], ['a'], ['jus', 'ti', 'fied'], ['jus', 'ti', 'fied'], ['to'], ['com', 'po', 'si', 'tion']], 10, 3], ['hyphena-', 'tion hy-', 'phenation', 'leading', 'breaking', 'of text a', 'justified', 'justified', 'to', 'composition']), ('regression: final word protection', [[['kern', 'ing'], ['com', 'po', 'si', 'tion'], ['to'], ['in', 'ter', 'na', 'tion', 'al'], ['line'], ['col', 'umn'], ['hy', 'phen', 'a', 'tion'], ['set', 'ting'], ['line'], ['set', 'ting']], 11, 3], ['kerning', 'composition', 'to interna-', 'tional line', 'column hy-', 'phenation', 'setting', 'line', 'setting']), ('partial-repair probe', [[['in', 'ter', 'na', 'tion', 'al'], ['in', 'ter', 'na', 'tion', 'al'], ['jus', 'ti', 'fied'], ['hy', 'phen', 'a', 'tion'], ['type'], ['hy', 'phen', 'a', 'tion'], ['text']], 12, 2], ['internation-', 'al interna-', 'tional', 'justified', 'hyphenation', 'type hyphen-', 'ation text']), ('partial-repair probe', [[['to'], ['hy', 'phen', 'a', 'tion'], ['line'], ['com', 'po', 'si', 'tion'], ['of']], 6, 3], ['to hy-', 'phena-', 'tion', 'line', 'compo-', 'sition', 'of']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('control layout', [[['of'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing'], ['type'], ['to'], ['jus', 'ti', 'fied'], ['to'], ['kern', 'ing'], ['type'], ['a']], 13, 3], ['of composi-', 'tion interna-', 'tional kern-', 'ing type to', 'justified to', 'kerning type', 'a']), ('control layout', [[['of'], ['break', 'ing'], ['type'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['break', 'ing']], 12, 3], ['of breaking', 'type compo-', 'sition in-', 'ternational', 'hyphenation', 'breaking'])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"b59d6784e3cacf7ce7cd3c5a8a31f59e4f1e7c68258b88c6e820d5942991e2b8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    words, width, limit = x\n    queue = [list(w) for w in words]\n    lines = []\n    cur = ''\n    streak = 0\n    k = 0\n    while k < len(queue):\n        syl = queue[k]\n        token = ''.join(syl)\n        need = len(token) if cur == '' else len(cur) + 1 + len(token)\n        if need <= width:\n            cur = token if cur == '' else cur + ' ' + token\n            k += 1\n            continue\n        split = None\n        if streak < limit and k < len(queue):\n            for cut in range(len(syl) - 1, 0, -1):\n                head = ''.join(syl[:cut]) + '-'\n                room = len(head) if cur == '' else len(cur) + len(head) + 1\n                if room <= width:\n                    split = cut\n                    break\n        if split is not None:\n            head = ''.join(syl[:split]) + '-'\n            lines.append(head if cur == '' else cur + ' ' + head)\n            queue[k] = syl[split:]\n            cur = ''\n            streak += 1\n        elif cur == '':\n            lines.append(token)\n            k += 1\n            streak = 0\n        else:\n            lines.append(cur)\n            cur, streak = '', 0\n    if cur:\n        lines.append(cur)\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('regression: final word protection', [[['to'], ['in', 'ter', 'na', 'tion', 'al'], ['a'], ['mar', 'gin'], ['a'], ['text'], ['a'], ['break', 'ing']], 7, 3], ['to in-', 'terna-', 'tional', 'a mar-', 'gin a', 'text a', 'breaking']), ('partial-repair probe', [[['text'], ['jus', 'ti', 'fied'], ['a'], ['hy', 'phen', 'a', 'tion'], ['set', 'ting'], ['line'], ['line'], ['jus', 'ti', 'fied'], ['col', 'umn'], ['jus', 'ti', 'fied'], ['com', 'po', 'si', 'tion']], 11, 1], ['text justi-', 'fied a', 'hyphenation', 'setting', 'line line', 'justified', 'column jus-', 'tified', 'composition']), ('regression: final word protection', [[['line'], ['pa', 'ra', 'graph'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing']], 6, 1], ['line', 'para-', 'graph', 'compo-', 'sition', 'hy-', 'phenation', 'para-', 'graph', 'inter-', 'national', 'kerning']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['kern', 'ing'], ['line'], ['type'], ['jus', 'ti', 'fied'], ['set', 'ting']], 11, 2], ['kerning', 'line type', 'justified', 'setting']), ('control layout', [[['hy', 'phen', 'a', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting'], ['set', 'ting'], ['a']], 10, 2], ['hyphena-', 'tion in-', 'ternational', 'setting', 'setting a']), ('control layout', [[['col', 'umn'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['type'], ['of'], ['of'], ['line'], ['set', 'ting'], ['pa', 'ra', 'graph'], ['kern', 'ing'], ['line']], 7, 3], ['column', 'compo-', 'sition', 'hyphen-', 'ation', 'leading', 'type of', 'of line', 'setting', 'para-', 'graph', 'kerning', 'line'])], [('regression: final word protection', [[['break', 'ing'], ['mar', 'gin'], ['hy', 'phen', 'a', 'tion'], ['jus', 'ti', 'fied'], ['a'], ['hy', 'phen', 'a', 'tion'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion']], 10, 3], ['breaking', 'margin hy-', 'phenation', 'justified', 'a hyphena-', 'tion com-', 'position', 'hyphenation']), ('regression: final word protection', [[['pa', 'ra', 'graph'], ['break', 'ing'], ['mar', 'gin'], ['hy', 'phen', 'a', 'tion'], ['kern', 'ing'], ['jus', 'ti', 'fied'], ['to'], ['kern', 'ing'], ['hy', 'phen', 'a', 'tion']], 12, 1], ['paragraph', 'breaking', 'margin hy-', 'phenation', 'kerning jus-', 'tified to', 'kerning', 'hyphenation']), ('partial-repair probe', [[['break', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['text'], ['of'], ['set', 'ting'], ['in', 'ter', 'na', 'tion', 'al'], ['line'], ['a'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting']], 9, 3], ['breaking', 'interna-', 'tional', 'text of', 'setting', 'interna-', 'tional', 'line a', 'interna-', 'tional', 'setting']), ('regression: final word protection', [[['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin'], ['break', 'ing'], ['mar', 'gin'], ['line'], ['set', 'ting'], ['in', 'ter', 'na', 'tion', 'al']], 6, 1], ['compo-', 'sition', 'inter-', 'national', 'margin', 'break-', 'ing', 'margin', 'line', 'set-', 'ting', 'international']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['set', 'ting'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['type'], ['type'], ['text'], ['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['a'], ['set', 'ting']], 11, 2], ['setting', 'justified', 'breaking', 'type type', 'text break-', 'ing hyphen-', 'ation a', 'setting']), ('control layout', [[['a'], ['line'], ['lead', 'ing'], ['break', 'ing'], ['text'], ['of'], ['com', 'po', 'si', 'tion'], ['to'], ['hy', 'phen', 'a', 'tion'], ['to'], ['type']], 6, 2], ['a line', 'lead-', 'ing', 'break-', 'ing', 'text', 'of', 'compo-', 'sition', 'to hy-', 'phena-', 'tion', 'to', 'type'])], [('regression: final word protection', [[['set', 'ting'], ['of'], ['mar', 'gin'], ['kern', 'ing'], ['set', 'ting'], ['col', 'umn'], ['line'], ['set', 'ting'], ['a'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin']], 11, 2], ['setting of', 'margin', 'kerning', 'setting', 'column line', 'setting a', 'interna-', 'tional', 'margin']), ('regression: final word protection', [[['a'], ['type'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['to'], ['to'], ['break', 'ing'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['type'], ['text'], ['hy', 'phen', 'a', 'tion']], 10, 3], ['a type in-', 'ternation-', 'al leading', 'to to', 'breaking', 'composi-', 'tion hy-', 'phenation', 'type text', 'hyphenation']), ('regression: final word protection', [[['text'], ['line'], ['to'], ['text'], ['lead', 'ing'], ['jus', 'ti', 'fied'], ['set', 'ting'], ['jus', 'ti', 'fied'], ['of'], ['break', 'ing'], ['com', 'po', 'si', 'tion']], 10, 3], ['text line', 'to text', 'leading', 'justified', 'setting', 'justified', 'of break-', 'ing', 'composition']), ('regression: final word protection', [[['break', 'ing'], ['of'], ['set', 'ting'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al']], 9, 3], ['breaking', 'of set-', 'ting mar-', 'gin', 'international']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('control layout', [[['kern', 'ing'], ['set', 'ting'], ['col', 'umn'], ['of'], ['text']], 7, 3], ['kerning', 'setting', 'column', 'of text']), ('control layout', [[['line'], ['in', 'ter', 'na', 'tion', 'al'], ['pa', 'ra', 'graph'], ['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['mar', 'gin'], ['to'], ['set', 'ting'], ['text'], ['mar', 'gin'], ['kern', 'ing'], ['jus', 'ti', 'fied']], 14, 1], ['line interna-', 'tional', 'paragraph in-', 'ternational', 'composition', 'margin to set-', 'ting text', 'margin kerning', 'justified'])], [('regression: final word protection', [[['line'], ['pa', 'ra', 'graph'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing']], 6, 1], ['line', 'para-', 'graph', 'compo-', 'sition', 'hy-', 'phenation', 'para-', 'graph', 'inter-', 'national', 'kerning']), ('regression: final word protection', [[['a'], ['break', 'ing'], ['text'], ['to'], ['mar', 'gin'], ['set', 'ting'], ['in', 'ter', 'na', 'tion', 'al'], ['in', 'ter', 'na', 'tion', 'al']], 6, 3], ['a', 'break-', 'ing', 'text', 'to', 'margin', 'set-', 'ting', 'inter-', 'na-', 'tional', 'international']), ('partial-repair probe', [[['jus', 'ti', 'fied'], ['break', 'ing'], ['to'], ['hy', 'phen', 'a', 'tion'], ['col', 'umn']], 9, 3], ['justified', 'breaking', 'to hy-', 'phenation', 'column']), ('regression: final word protection', [[['break', 'ing'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['break', 'ing'], ['text'], ['set', 'ting'], ['lead', 'ing']], 11, 3], ['breaking', 'composition', 'interna-', 'tional', 'breaking', 'text set-', 'ting', 'leading']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['mar', 'gin'], ['text'], ['lead', 'ing'], ['col', 'umn'], ['hy', 'phen', 'a', 'tion'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin'], ['set', 'ting'], ['to'], ['jus', 'ti', 'fied'], ['lead', 'ing']], 13, 1], ['margin text', 'leading col-', 'umn', 'hyphenation', 'margin inter-', 'national', 'margin set-', 'ting to', 'justified', 'leading']), ('control layout', [[['to'], ['set', 'ting'], ['of'], ['lead', 'ing'], ['lead', 'ing'], ['of'], ['com', 'po', 'si', 'tion'], ['set', 'ting'], ['lead', 'ing']], 12, 2], ['to setting', 'of leading', 'leading of', 'composition', 'setting', 'leading'])], [('regression: final word protection', [[['hy', 'phen', 'a', 'tion'], ['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['break', 'ing'], ['of'], ['text'], ['a'], ['jus', 'ti', 'fied'], ['jus', 'ti', 'fied'], ['to'], ['com', 'po', 'si', 'tion']], 10, 3], ['hyphena-', 'tion hy-', 'phenation', 'leading', 'breaking', 'of text a', 'justified', 'justified', 'to', 'composition']), ('regression: final word protection', [[['kern', 'ing'], ['com', 'po', 'si', 'tion'], ['to'], ['in', 'ter', 'na', 'tion', 'al'], ['line'], ['col', 'umn'], ['hy', 'phen', 'a', 'tion'], ['set', 'ting'], ['line'], ['set', 'ting']], 11, 3], ['kerning', 'composition', 'to interna-', 'tional line', 'column hy-', 'phenation', 'setting', 'line', 'setting']), ('partial-repair probe', [[['in', 'ter', 'na', 'tion', 'al'], ['in', 'ter', 'na', 'tion', 'al'], ['jus', 'ti', 'fied'], ['hy', 'phen', 'a', 'tion'], ['type'], ['hy', 'phen', 'a', 'tion'], ['text']], 12, 2], ['internation-', 'al interna-', 'tional', 'justified', 'hyphenation', 'type hyphen-', 'ation text']), ('partial-repair probe', [[['to'], ['hy', 'phen', 'a', 'tion'], ['line'], ['com', 'po', 'si', 'tion'], ['of']], 6, 3], ['to hy-', 'phena-', 'tion', 'line', 'compo-', 'sition', 'of']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('control layout', [[['of'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing'], ['type'], ['to'], ['jus', 'ti', 'fied'], ['to'], ['kern', 'ing'], ['type'], ['a']], 13, 3], ['of composi-', 'tion interna-', 'tional kern-', 'ing type to', 'justified to', 'kerning type', 'a']), ('control layout', [[['of'], ['break', 'ing'], ['type'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['break', 'ing']], 12, 3], ['of breaking', 'type compo-', 'sition in-', 'ternational', 'hyphenation', 'breaking'])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"137a6d22c1db92597d76e8ea1880f4f2d841ced63f18de2c11883688f14d8587","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    words, width, limit = x\n    queue = [list(w) for w in words]\n    lines = []\n    cur = ''\n    streak = 0\n    k = 0\n    while k < len(queue):\n        syl = queue[k]\n        token = ''.join(syl)\n        need = len(token) if cur == '' else len(cur) + 1 + len(token)\n        if need <= width:\n            cur = token if cur == '' else cur + ' ' + token\n            k += 1\n            continue\n        split = None\n        if streak < limit and k < len(queue) - 1:\n            for cut in range(len(syl) - 1, 0, -1):\n                head = ''.join(syl[:cut]) + '-'\n                room = len(head) if cur == '' else len(cur) + len(head) + 1\n                if room <= width:\n                    split = cut\n                    break\n        if split is not None:\n            head = ''.join(syl[:split]) + '-'\n            lines.append(head if cur == '' else cur + ' ' + head)\n            queue[k] = syl[split:]\n            cur = ''\n            streak += 1\n        elif cur == '':\n            lines.append(token)\n            k += 1\n            streak = 0\n        else:\n            lines.append(cur)\n            cur, streak = '', 0\n    if cur:\n        lines.append(cur)\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('regression: final word protection', [[['to'], ['in', 'ter', 'na', 'tion', 'al'], ['a'], ['mar', 'gin'], ['a'], ['text'], ['a'], ['break', 'ing']], 7, 3], ['to in-', 'terna-', 'tional', 'a mar-', 'gin a', 'text a', 'breaking']), ('partial-repair probe', [[['text'], ['jus', 'ti', 'fied'], ['a'], ['hy', 'phen', 'a', 'tion'], ['set', 'ting'], ['line'], ['line'], ['jus', 'ti', 'fied'], ['col', 'umn'], ['jus', 'ti', 'fied'], ['com', 'po', 'si', 'tion']], 11, 1], ['text justi-', 'fied a', 'hyphenation', 'setting', 'line line', 'justified', 'column jus-', 'tified', 'composition']), ('regression: final word protection', [[['line'], ['pa', 'ra', 'graph'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing']], 6, 1], ['line', 'para-', 'graph', 'compo-', 'sition', 'hy-', 'phenation', 'para-', 'graph', 'inter-', 'national', 'kerning']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['kern', 'ing'], ['line'], ['type'], ['jus', 'ti', 'fied'], ['set', 'ting']], 11, 2], ['kerning', 'line type', 'justified', 'setting']), ('control layout', [[['hy', 'phen', 'a', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting'], ['set', 'ting'], ['a']], 10, 2], ['hyphena-', 'tion in-', 'ternational', 'setting', 'setting a']), ('control layout', [[['col', 'umn'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['type'], ['of'], ['of'], ['line'], ['set', 'ting'], ['pa', 'ra', 'graph'], ['kern', 'ing'], ['line']], 7, 3], ['column', 'compo-', 'sition', 'hyphen-', 'ation', 'leading', 'type of', 'of line', 'setting', 'para-', 'graph', 'kerning', 'line'])], [('regression: final word protection', [[['break', 'ing'], ['mar', 'gin'], ['hy', 'phen', 'a', 'tion'], ['jus', 'ti', 'fied'], ['a'], ['hy', 'phen', 'a', 'tion'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion']], 10, 3], ['breaking', 'margin hy-', 'phenation', 'justified', 'a hyphena-', 'tion com-', 'position', 'hyphenation']), ('regression: final word protection', [[['pa', 'ra', 'graph'], ['break', 'ing'], ['mar', 'gin'], ['hy', 'phen', 'a', 'tion'], ['kern', 'ing'], ['jus', 'ti', 'fied'], ['to'], ['kern', 'ing'], ['hy', 'phen', 'a', 'tion']], 12, 1], ['paragraph', 'breaking', 'margin hy-', 'phenation', 'kerning jus-', 'tified to', 'kerning', 'hyphenation']), ('partial-repair probe', [[['break', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['text'], ['of'], ['set', 'ting'], ['in', 'ter', 'na', 'tion', 'al'], ['line'], ['a'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting']], 9, 3], ['breaking', 'interna-', 'tional', 'text of', 'setting', 'interna-', 'tional', 'line a', 'interna-', 'tional', 'setting']), ('regression: final word protection', [[['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin'], ['break', 'ing'], ['mar', 'gin'], ['line'], ['set', 'ting'], ['in', 'ter', 'na', 'tion', 'al']], 6, 1], ['compo-', 'sition', 'inter-', 'national', 'margin', 'break-', 'ing', 'margin', 'line', 'set-', 'ting', 'international']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['set', 'ting'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['type'], ['type'], ['text'], ['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['a'], ['set', 'ting']], 11, 2], ['setting', 'justified', 'breaking', 'type type', 'text break-', 'ing hyphen-', 'ation a', 'setting']), ('control layout', [[['a'], ['line'], ['lead', 'ing'], ['break', 'ing'], ['text'], ['of'], ['com', 'po', 'si', 'tion'], ['to'], ['hy', 'phen', 'a', 'tion'], ['to'], ['type']], 6, 2], ['a line', 'lead-', 'ing', 'break-', 'ing', 'text', 'of', 'compo-', 'sition', 'to hy-', 'phena-', 'tion', 'to', 'type'])], [('regression: final word protection', [[['set', 'ting'], ['of'], ['mar', 'gin'], ['kern', 'ing'], ['set', 'ting'], ['col', 'umn'], ['line'], ['set', 'ting'], ['a'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin']], 11, 2], ['setting of', 'margin', 'kerning', 'setting', 'column line', 'setting a', 'interna-', 'tional', 'margin']), ('regression: final word protection', [[['a'], ['type'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['to'], ['to'], ['break', 'ing'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['type'], ['text'], ['hy', 'phen', 'a', 'tion']], 10, 3], ['a type in-', 'ternation-', 'al leading', 'to to', 'breaking', 'composi-', 'tion hy-', 'phenation', 'type text', 'hyphenation']), ('regression: final word protection', [[['text'], ['line'], ['to'], ['text'], ['lead', 'ing'], ['jus', 'ti', 'fied'], ['set', 'ting'], ['jus', 'ti', 'fied'], ['of'], ['break', 'ing'], ['com', 'po', 'si', 'tion']], 10, 3], ['text line', 'to text', 'leading', 'justified', 'setting', 'justified', 'of break-', 'ing', 'composition']), ('regression: final word protection', [[['break', 'ing'], ['of'], ['set', 'ting'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al']], 9, 3], ['breaking', 'of set-', 'ting mar-', 'gin', 'international']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('control layout', [[['kern', 'ing'], ['set', 'ting'], ['col', 'umn'], ['of'], ['text']], 7, 3], ['kerning', 'setting', 'column', 'of text']), ('control layout', [[['line'], ['in', 'ter', 'na', 'tion', 'al'], ['pa', 'ra', 'graph'], ['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['mar', 'gin'], ['to'], ['set', 'ting'], ['text'], ['mar', 'gin'], ['kern', 'ing'], ['jus', 'ti', 'fied']], 14, 1], ['line interna-', 'tional', 'paragraph in-', 'ternational', 'composition', 'margin to set-', 'ting text', 'margin kerning', 'justified'])], [('regression: final word protection', [[['line'], ['pa', 'ra', 'graph'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing']], 6, 1], ['line', 'para-', 'graph', 'compo-', 'sition', 'hy-', 'phenation', 'para-', 'graph', 'inter-', 'national', 'kerning']), ('regression: final word protection', [[['a'], ['break', 'ing'], ['text'], ['to'], ['mar', 'gin'], ['set', 'ting'], ['in', 'ter', 'na', 'tion', 'al'], ['in', 'ter', 'na', 'tion', 'al']], 6, 3], ['a', 'break-', 'ing', 'text', 'to', 'margin', 'set-', 'ting', 'inter-', 'na-', 'tional', 'international']), ('partial-repair probe', [[['jus', 'ti', 'fied'], ['break', 'ing'], ['to'], ['hy', 'phen', 'a', 'tion'], ['col', 'umn']], 9, 3], ['justified', 'breaking', 'to hy-', 'phenation', 'column']), ('regression: final word protection', [[['break', 'ing'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['break', 'ing'], ['text'], ['set', 'ting'], ['lead', 'ing']], 11, 3], ['breaking', 'composition', 'interna-', 'tional', 'breaking', 'text set-', 'ting', 'leading']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['mar', 'gin'], ['text'], ['lead', 'ing'], ['col', 'umn'], ['hy', 'phen', 'a', 'tion'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin'], ['set', 'ting'], ['to'], ['jus', 'ti', 'fied'], ['lead', 'ing']], 13, 1], ['margin text', 'leading col-', 'umn', 'hyphenation', 'margin inter-', 'national', 'margin set-', 'ting to', 'justified', 'leading']), ('control layout', [[['to'], ['set', 'ting'], ['of'], ['lead', 'ing'], ['lead', 'ing'], ['of'], ['com', 'po', 'si', 'tion'], ['set', 'ting'], ['lead', 'ing']], 12, 2], ['to setting', 'of leading', 'leading of', 'composition', 'setting', 'leading'])], [('regression: final word protection', [[['hy', 'phen', 'a', 'tion'], ['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['break', 'ing'], ['of'], ['text'], ['a'], ['jus', 'ti', 'fied'], ['jus', 'ti', 'fied'], ['to'], ['com', 'po', 'si', 'tion']], 10, 3], ['hyphena-', 'tion hy-', 'phenation', 'leading', 'breaking', 'of text a', 'justified', 'justified', 'to', 'composition']), ('regression: final word protection', [[['kern', 'ing'], ['com', 'po', 'si', 'tion'], ['to'], ['in', 'ter', 'na', 'tion', 'al'], ['line'], ['col', 'umn'], ['hy', 'phen', 'a', 'tion'], ['set', 'ting'], ['line'], ['set', 'ting']], 11, 3], ['kerning', 'composition', 'to interna-', 'tional line', 'column hy-', 'phenation', 'setting', 'line', 'setting']), ('partial-repair probe', [[['in', 'ter', 'na', 'tion', 'al'], ['in', 'ter', 'na', 'tion', 'al'], ['jus', 'ti', 'fied'], ['hy', 'phen', 'a', 'tion'], ['type'], ['hy', 'phen', 'a', 'tion'], ['text']], 12, 2], ['internation-', 'al interna-', 'tional', 'justified', 'hyphenation', 'type hyphen-', 'ation text']), ('partial-repair probe', [[['to'], ['hy', 'phen', 'a', 'tion'], ['line'], ['com', 'po', 'si', 'tion'], ['of']], 6, 3], ['to hy-', 'phena-', 'tion', 'line', 'compo-', 'sition', 'of']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('control layout', [[['of'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing'], ['type'], ['to'], ['jus', 'ti', 'fied'], ['to'], ['kern', 'ing'], ['type'], ['a']], 13, 3], ['of composi-', 'tion interna-', 'tional kern-', 'ing type to', 'justified to', 'kerning type', 'a']), ('control layout', [[['of'], ['break', 'ing'], ['type'], ['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['break', 'ing']], 12, 3], ['of breaking', 'type compo-', 'sition in-', 'ternational', 'hyphenation', 'breaking'])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-typography-line-breaking-hyphen-ladder-final-word-protection","generated_at":"2026-09-29T14:49:49.572126+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Line breaking decides where paragraphs wrap on screen and in print; a wrong decision point shifts every following line.","repair":"Never hyphenate the final word of the paragraph.","root_cause":"The last-word guard compares against len(queue) so the final word is also eligible.","sha256":"07f47d0131745ca24907b9f6b02e7387550400115a3e7832821beabd8a23213c","title":"Consecutive hyphen limit: final word protection · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":45.629,"exit_code":1,"observations":[{"actual":["a","composition"],"check":"last word never hyphenated","expected":["a","composition"],"passed":true},{"actual":["to in-","terna-","tional","a mar-","gin a","text a","breaking"],"check":"regression: final word protection","expected":["to in-","terna-","tional","a mar-","gin a","text a","breaking"],"passed":true},{"actual":["text justi-","fied a","hyphenation","setting","line line","justified","column","justified","composition"],"check":"partial-repair probe","expected":["text justi-","fied a","hyphenation","setting","line line","justified","column jus-","tified","composition"],"passed":false},{"actual":["line","para-","graph","compo-","sition","hy-","phenation","para-","graph","international","kerning"],"check":"regression: final word protection","expected":["line","para-","graph","compo-","sition","hy-","phenation","para-","graph","inter-","national","kerning"],"passed":false},{"actual":["inter-","nation-","al","compo-","sition","hyphenation","text"],"check":"ladder of three hyphenated lines","expected":["inter-","nation-","al","compo-","sition","hyphen-","ation","text"],"passed":false},{"actual":["kerning","line type","justified","setting"],"check":"control layout","expected":["kerning","line type","justified","setting"],"passed":true},{"actual":["hyphena-","tion in-","ternational","setting","setting a"],"check":"control layout","expected":["hyphena-","tion in-","ternational","setting","setting a"],"passed":true},{"actual":["column","compo-","sition","hyphen-","ation","leading","type of","of line","setting","para-","graph","kerning","line"],"check":"control layout","expected":["column","compo-","sition","hyphen-","ation","leading","type of","of line","setting","para-","graph","kerning","line"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"last word never hyphenated\", \"actual\": [\"a\", \"composition\"], \"expected\": [\"a\", \"composition\"], \"passed\": true}, {\"check\": \"regression: final word protection\", \"actual\": [\"to in-\", \"terna-\", \"tional\", \"a mar-\", \"gin a\", \"text a\", \"breaking\"], \"expected\": [\"to in-\", \"terna-\", \"tional\", \"a mar-\", \"gin a\", \"text a\", \"breaking\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"text justi-\", \"fied a\", \"hyphenation\", \"setting\", \"line line\", \"justified\", \"column\", \"justified\", \"composition\"], \"expected\": [\"text justi-\", \"fied a\", \"hyphenation\", \"setting\", \"line line\", \"justified\", \"column jus-\", \"tified\", \"composition\"], \"passed\": false}, {\"check\": \"regression: final word protection\", \"actual\": [\"line\", \"para-\", \"graph\", \"compo-\", \"sition\", \"hy-\", \"phenation\", \"para-\", \"graph\", \"international\", \"kerning\"], \"expected\": [\"line\", \"para-\", \"graph\", \"compo-\", \"sition\", \"hy-\", \"phenation\", \"para-\", \"graph\", \"inter-\", \"national\", \"kerning\"], \"passed\": false}, {\"check\": \"ladder of three hyphenated lines\", \"actual\": [\"inter-\", \"nation-\", \"al\", \"compo-\", \"sition\", \"hyphenation\", \"text\"], \"expected\": [\"inter-\", \"nation-\", \"al\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"text\"], \"passed\": false}, {\"check\": \"control layout\", \"actual\": [\"kerning\", \"line type\", \"justified\", \"setting\"], \"expected\": [\"kerning\", \"line type\", \"justified\", \"setting\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"hyphena-\", \"tion in-\", \"ternational\", \"setting\", \"setting a\"], \"expected\": [\"hyphena-\", \"tion in-\", \"ternational\", \"setting\", \"setting a\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"column\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"leading\", \"type of\", \"of line\", \"setting\", \"para-\", \"graph\", \"kerning\", \"line\"], \"expected\": [\"column\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"leading\", \"type of\", \"of line\", \"setting\", \"para-\", \"graph\", \"kerning\", \"line\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":46.042,"exit_code":1,"observations":[{"actual":["a compo-","sition"],"check":"last word never hyphenated","expected":["a","composition"],"passed":false},{"actual":["to in-","terna-","tional","a mar-","gin a","text a","break-","ing"],"check":"regression: final word protection","expected":["to in-","terna-","tional","a mar-","gin a","text a","breaking"],"passed":false},{"actual":["text justi-","fied a","hyphenation","setting","line line","justified","column jus-","tified","composition"],"check":"partial-repair probe","expected":["text justi-","fied a","hyphenation","setting","line line","justified","column jus-","tified","composition"],"passed":true},{"actual":["line","para-","graph","compo-","sition","hy-","phenation","para-","graph","inter-","national","kern-","ing"],"check":"regression: final word protection","expected":["line","para-","graph","compo-","sition","hy-","phenation","para-","graph","inter-","national","kerning"],"passed":false},{"actual":["inter-","nation-","al","compo-","sition","hyphen-","ation","text"],"check":"ladder of three hyphenated lines","expected":["inter-","nation-","al","compo-","sition","hyphen-","ation","text"],"passed":true},{"actual":["kerning","line type","justified","setting"],"check":"control layout","expected":["kerning","line type","justified","setting"],"passed":true},{"actual":["hyphena-","tion in-","ternational","setting","setting a"],"check":"control layout","expected":["hyphena-","tion in-","ternational","setting","setting a"],"passed":true},{"actual":["column","compo-","sition","hyphen-","ation","leading","type of","of line","setting","para-","graph","kerning","line"],"check":"control layout","expected":["column","compo-","sition","hyphen-","ation","leading","type of","of line","setting","para-","graph","kerning","line"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"last word never hyphenated\", \"actual\": [\"a compo-\", \"sition\"], \"expected\": [\"a\", \"composition\"], \"passed\": false}, {\"check\": \"regression: final word protection\", \"actual\": [\"to in-\", \"terna-\", \"tional\", \"a mar-\", \"gin a\", \"text a\", \"break-\", \"ing\"], \"expected\": [\"to in-\", \"terna-\", \"tional\", \"a mar-\", \"gin a\", \"text a\", \"breaking\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"text justi-\", \"fied a\", \"hyphenation\", \"setting\", \"line line\", \"justified\", \"column jus-\", \"tified\", \"composition\"], \"expected\": [\"text justi-\", \"fied a\", \"hyphenation\", \"setting\", \"line line\", \"justified\", \"column jus-\", \"tified\", \"composition\"], \"passed\": true}, {\"check\": \"regression: final word protection\", \"actual\": [\"line\", \"para-\", \"graph\", \"compo-\", \"sition\", \"hy-\", \"phenation\", \"para-\", \"graph\", \"inter-\", \"national\", \"kern-\", \"ing\"], \"expected\": [\"line\", \"para-\", \"graph\", \"compo-\", \"sition\", \"hy-\", \"phenation\", \"para-\", \"graph\", \"inter-\", \"national\", \"kerning\"], \"passed\": false}, {\"check\": \"ladder of three hyphenated lines\", \"actual\": [\"inter-\", \"nation-\", \"al\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"text\"], \"expected\": [\"inter-\", \"nation-\", \"al\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"text\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"kerning\", \"line type\", \"justified\", \"setting\"], \"expected\": [\"kerning\", \"line type\", \"justified\", \"setting\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"hyphena-\", \"tion in-\", \"ternational\", \"setting\", \"setting a\"], \"expected\": [\"hyphena-\", \"tion in-\", \"ternational\", \"setting\", \"setting a\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"column\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"leading\", \"type of\", \"of line\", \"setting\", \"para-\", \"graph\", \"kerning\", \"line\"], \"expected\": [\"column\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"leading\", \"type of\", \"of line\", \"setting\", \"para-\", \"graph\", \"kerning\", \"line\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.306,"exit_code":0,"observations":[{"actual":["a","composition"],"check":"last word never hyphenated","expected":["a","composition"],"passed":true},{"actual":["to in-","terna-","tional","a mar-","gin a","text a","breaking"],"check":"regression: final word protection","expected":["to in-","terna-","tional","a mar-","gin a","text a","breaking"],"passed":true},{"actual":["text justi-","fied a","hyphenation","setting","line line","justified","column jus-","tified","composition"],"check":"partial-repair probe","expected":["text justi-","fied a","hyphenation","setting","line line","justified","column jus-","tified","composition"],"passed":true},{"actual":["line","para-","graph","compo-","sition","hy-","phenation","para-","graph","inter-","national","kerning"],"check":"regression: final word protection","expected":["line","para-","graph","compo-","sition","hy-","phenation","para-","graph","inter-","national","kerning"],"passed":true},{"actual":["inter-","nation-","al","compo-","sition","hyphen-","ation","text"],"check":"ladder of three hyphenated lines","expected":["inter-","nation-","al","compo-","sition","hyphen-","ation","text"],"passed":true},{"actual":["kerning","line type","justified","setting"],"check":"control layout","expected":["kerning","line type","justified","setting"],"passed":true},{"actual":["hyphena-","tion in-","ternational","setting","setting a"],"check":"control layout","expected":["hyphena-","tion in-","ternational","setting","setting a"],"passed":true},{"actual":["column","compo-","sition","hyphen-","ation","leading","type of","of line","setting","para-","graph","kerning","line"],"check":"control layout","expected":["column","compo-","sition","hyphen-","ation","leading","type of","of line","setting","para-","graph","kerning","line"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"last word never hyphenated\", \"actual\": [\"a\", \"composition\"], \"expected\": [\"a\", \"composition\"], \"passed\": true}, {\"check\": \"regression: final word protection\", \"actual\": [\"to in-\", \"terna-\", \"tional\", \"a mar-\", \"gin a\", \"text a\", \"breaking\"], \"expected\": [\"to in-\", \"terna-\", \"tional\", \"a mar-\", \"gin a\", \"text a\", \"breaking\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"text justi-\", \"fied a\", \"hyphenation\", \"setting\", \"line line\", \"justified\", \"column jus-\", \"tified\", \"composition\"], \"expected\": [\"text justi-\", \"fied a\", \"hyphenation\", \"setting\", \"line line\", \"justified\", \"column jus-\", \"tified\", \"composition\"], \"passed\": true}, {\"check\": \"regression: final word protection\", \"actual\": [\"line\", \"para-\", \"graph\", \"compo-\", \"sition\", \"hy-\", \"phenation\", \"para-\", \"graph\", \"inter-\", \"national\", \"kerning\"], \"expected\": [\"line\", \"para-\", \"graph\", \"compo-\", \"sition\", \"hy-\", \"phenation\", \"para-\", \"graph\", \"inter-\", \"national\", \"kerning\"], \"passed\": true}, {\"check\": \"ladder of three hyphenated lines\", \"actual\": [\"inter-\", \"nation-\", \"al\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"text\"], \"expected\": [\"inter-\", \"nation-\", \"al\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"text\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"kerning\", \"line type\", \"justified\", \"setting\"], \"expected\": [\"kerning\", \"line type\", \"justified\", \"setting\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"hyphena-\", \"tion in-\", \"ternational\", \"setting\", \"setting a\"], \"expected\": [\"hyphena-\", \"tion in-\", \"ternational\", \"setting\", \"setting a\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"column\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"leading\", \"type of\", \"of line\", \"setting\", \"para-\", \"graph\", \"kerning\", \"line\"], \"expected\": [\"column\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"leading\", \"type of\", \"of line\", \"setting\", \"para-\", \"graph\", \"kerning\", \"line\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}