{"abstract":"Words that exactly fill the measure are pushed to the next line.","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.","contract_signature":"x","evaluation_group":"w2-typography-line-breaking-hyphen-ladder","failed_approach":"Allowing width + 1 overfills the measure.","family":"w2-typography-line-breaking-hyphen-ladder-whole-word-fit-test","id":"FA-79971","implementations":{"attempt":{"sha256":"4bec4c389cef829ed27fe591d2e00ddb05a7a7b4bb8ef8b083527effd9fdcf10","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 + 1:\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 = [[('regression: whole-word fit test', [[['lead', 'ing'], ['a'], ['jus', 'ti', 'fied'], ['a'], ['a'], ['pa', 'ra', 'graph'], ['set', 'ting'], ['jus', 'ti', 'fied']], 6, 1], ['lead-', 'ing a', 'justi-', 'fied a', 'a pa-', 'ragraph', 'set-', 'ting', 'justified']), ('regression: whole-word fit test', [[['lead', 'ing'], ['kern', 'ing'], ['com', 'po', 'si', 'tion'], ['text'], ['lead', 'ing'], ['kern', 'ing'], ['hy', 'phen', 'a', 'tion'], ['hy', 'phen', 'a', 'tion'], ['a'], ['text'], ['pa', 'ra', 'graph']], 14, 1], ['leading kern-', 'ing', 'composition', 'text leading', 'kerning hy-', 'phenation', 'hyphenation a', 'text paragraph']), ('partial-repair probe', [[['break', 'ing'], ['kern', 'ing'], ['set', 'ting'], ['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['to'], ['line'], ['jus', 'ti', 'fied']], 12, 1], ['breaking', 'kerning set-', 'ting', 'breaking hy-', 'phenation', 'leading to', 'line', 'justified']), ('regression: whole-word fit test', [[['to'], ['line'], ['com', 'po', 'si', 'tion'], ['mar', 'gin'], ['mar', 'gin'], ['type'], ['kern', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['col', 'umn'], ['line'], ['com', 'po', 'si', 'tion'], ['to']], 14, 1], ['to line compo-', 'sition margin', 'margin type', 'kerning inter-', 'national', 'column line', 'composition to']), ('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', [[['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['a'], ['hy', 'phen', 'a', 'tion'], ['break', 'ing']], 9, 3], ['interna-', 'tional', 'hyphena-', 'tion a', 'hyphena-', 'tion', 'breaking']), ('control layout', [[['text'], ['line'], ['hy', 'phen', 'a', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['set', 'ting']], 14, 2], ['text line hy-', 'phenation in-', 'ternational', 'composition', 'setting'])], [('regression: whole-word fit test', [[['pa', 'ra', 'graph'], ['of'], ['type'], ['lead', 'ing'], ['col', 'umn'], ['pa', 'ra', 'graph'], ['lead', 'ing'], ['kern', 'ing'], ['set', 'ting']], 7, 3], ['para-', 'graph', 'of type', 'leading', 'column', 'para-', 'graph', 'leading', 'kerning', 'setting']), ('regression: whole-word fit test', [[['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['to'], ['in', 'ter', 'na', 'tion', 'al'], ['a'], ['set', 'ting'], ['col', 'umn']], 13, 3], ['hyphenation', 'leading to', 'international', 'a setting', 'column']), ('partial-repair probe', [[['jus', 'ti', 'fied'], ['text'], ['of'], ['in', 'ter', 'na', 'tion', 'al'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin'], ['mar', 'gin'], ['of'], ['break', 'ing'], ['line']], 12, 1], ['justified', 'text of in-', 'ternational', 'internation-', 'al margin', 'margin of', 'breaking', 'line']), ('partial-repair probe', [[['lead', 'ing'], ['pa', 'ra', 'graph'], ['to'], ['mar', 'gin'], ['line'], ['jus', 'ti', 'fied']], 14, 3], ['leading para-', 'graph to mar-', 'gin line', 'justified']), ('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', [[['jus', 'ti', 'fied'], ['col', 'umn'], ['com', 'po', 'si', 'tion'], ['pa', 'ra', 'graph'], ['to'], ['jus', 'ti', 'fied'], ['mar', 'gin']], 12, 2], ['justified', 'column com-', 'position pa-', 'ragraph to', 'justified', 'margin']), ('control layout', [[['a'], ['kern', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting'], ['pa', 'ra', 'graph']], 11, 1], ['a kerning', 'interna-', 'tional', 'setting', 'paragraph'])], [('regression: whole-word fit test', [[['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']), ('regression: whole-word fit test', [[['col', 'umn'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing'], ['type'], ['lead', 'ing'], ['lead', 'ing'], ['text'], ['text'], ['pa', 'ra', 'graph']], 6, 1], ['column', 'inter-', 'national', 'kern-', 'ing', 'type', 'lead-', 'ing', 'lead-', 'ing', 'text', 'text', 'paragraph']), ('regression: whole-word fit test', [[['line'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin'], ['pa', 'ra', 'graph'], ['a'], ['a']], 7, 2], ['line', 'inter-', 'nation-', 'al', 'margin', 'para-', 'graph a', 'a']), ('regression: whole-word fit test', [[['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']), ('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', [[['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']), ('control layout', [[['a'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing'], ['col', 'umn'], ['col', 'umn'], ['lead', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['to'], ['break', 'ing'], ['jus', 'ti', 'fied']], 12, 1], ['a margin in-', 'ternational', 'kerning col-', 'umn column', 'leading in-', 'ternational', 'to breaking', 'justified'])], [('regression: whole-word fit test', [[['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: whole-word fit test', [[['type'], ['col', 'umn'], ['lead', 'ing'], ['lead', 'ing'], ['of'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al']], 10, 1], ['type col-', 'umn', 'leading', 'leading of', 'margin', 'international']), ('regression: whole-word fit test', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['type'], ['hy', 'phen', 'a', 'tion'], ['col', 'umn'], ['of'], ['pa', 'ra', 'graph'], ['hy', 'phen', 'a', 'tion']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'type', 'hyphen-', 'ation', 'column', 'of pa-', 'ragraph', 'hyphenation']), ('regression: whole-word fit test', [[['mar', 'gin'], ['pa', 'ra', 'graph'], ['lead', 'ing'], ['of'], ['type'], ['col', 'umn'], ['lead', 'ing']], 9, 3], ['margin', 'paragraph', 'leading', 'of type', 'column', 'leading']), ('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', [[['pa', 'ra', 'graph'], ['to'], ['jus', 'ti', 'fied'], ['lead', 'ing'], ['to'], ['col', 'umn']], 13, 2], ['paragraph to', 'justified', 'leading to', 'column']), ('control layout', [[['set', 'ting'], ['to'], ['break', 'ing'], ['com', 'po', 'si', 'tion'], ['lead', 'ing'], ['line'], ['jus', 'ti', 'fied'], ['a'], ['break', 'ing'], ['a'], ['line']], 13, 2], ['setting to', 'breaking com-', 'position', 'leading line', 'justified a', 'breaking a', 'line'])], [('regression: whole-word fit test', [[['line'], ['com', 'po', 'si', 'tion'], ['of'], ['to'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['pa', 'ra', 'graph'], ['hy', 'phen', 'a', 'tion'], ['set', 'ting']], 10, 3], ['line com-', 'position', 'of to in-', 'ternation-', 'al leading', 'paragraph', 'hyphena-', 'tion', 'setting']), ('regression: whole-word fit test', [[['lead', 'ing'], ['kern', 'ing'], ['hy', 'phen', 'a', 'tion'], ['kern', 'ing'], ['col', 'umn'], ['com', 'po', 'si', 'tion'], ['lead', 'ing'], ['text'], ['of'], ['jus', 'ti', 'fied'], ['type'], ['kern', 'ing']], 12, 1], ['leading', 'kerning hy-', 'phenation', 'kerning col-', 'umn', 'composition', 'leading text', 'of justified', 'type kerning']), ('partial-repair probe', [[['hy', 'phen', 'a', 'tion'], ['type'], ['mar', 'gin'], ['a'], ['jus', 'ti', 'fied'], ['col', 'umn'], ['break', 'ing'], ['com', 'po', 'si', 'tion'], ['line']], 12, 2], ['hyphenation', 'type margin', 'a justified', 'column', 'breaking', 'composition', 'line']), ('partial-repair probe', [[['type'], ['mar', 'gin'], ['of'], ['a'], ['col', 'umn']], 8, 3], ['type', 'margin', 'of a', 'column']), ('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', [[['col', 'umn'], ['kern', 'ing'], ['text'], ['col', 'umn'], ['line'], ['line'], ['a']], 12, 2], ['column kern-', 'ing text', 'column line', 'line 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":"e244e15e7454c2fb755300eb9468d316174afb7c0c3105dd24e5fa26bc9eb5dd","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 = [[('regression: whole-word fit test', [[['lead', 'ing'], ['a'], ['jus', 'ti', 'fied'], ['a'], ['a'], ['pa', 'ra', 'graph'], ['set', 'ting'], ['jus', 'ti', 'fied']], 6, 1], ['lead-', 'ing a', 'justi-', 'fied a', 'a pa-', 'ragraph', 'set-', 'ting', 'justified']), ('regression: whole-word fit test', [[['lead', 'ing'], ['kern', 'ing'], ['com', 'po', 'si', 'tion'], ['text'], ['lead', 'ing'], ['kern', 'ing'], ['hy', 'phen', 'a', 'tion'], ['hy', 'phen', 'a', 'tion'], ['a'], ['text'], ['pa', 'ra', 'graph']], 14, 1], ['leading kern-', 'ing', 'composition', 'text leading', 'kerning hy-', 'phenation', 'hyphenation a', 'text paragraph']), ('partial-repair probe', [[['break', 'ing'], ['kern', 'ing'], ['set', 'ting'], ['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['to'], ['line'], ['jus', 'ti', 'fied']], 12, 1], ['breaking', 'kerning set-', 'ting', 'breaking hy-', 'phenation', 'leading to', 'line', 'justified']), ('regression: whole-word fit test', [[['to'], ['line'], ['com', 'po', 'si', 'tion'], ['mar', 'gin'], ['mar', 'gin'], ['type'], ['kern', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['col', 'umn'], ['line'], ['com', 'po', 'si', 'tion'], ['to']], 14, 1], ['to line compo-', 'sition margin', 'margin type', 'kerning inter-', 'national', 'column line', 'composition to']), ('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', [[['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['a'], ['hy', 'phen', 'a', 'tion'], ['break', 'ing']], 9, 3], ['interna-', 'tional', 'hyphena-', 'tion a', 'hyphena-', 'tion', 'breaking']), ('control layout', [[['text'], ['line'], ['hy', 'phen', 'a', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['set', 'ting']], 14, 2], ['text line hy-', 'phenation in-', 'ternational', 'composition', 'setting'])], [('regression: whole-word fit test', [[['pa', 'ra', 'graph'], ['of'], ['type'], ['lead', 'ing'], ['col', 'umn'], ['pa', 'ra', 'graph'], ['lead', 'ing'], ['kern', 'ing'], ['set', 'ting']], 7, 3], ['para-', 'graph', 'of type', 'leading', 'column', 'para-', 'graph', 'leading', 'kerning', 'setting']), ('regression: whole-word fit test', [[['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['to'], ['in', 'ter', 'na', 'tion', 'al'], ['a'], ['set', 'ting'], ['col', 'umn']], 13, 3], ['hyphenation', 'leading to', 'international', 'a setting', 'column']), ('partial-repair probe', [[['jus', 'ti', 'fied'], ['text'], ['of'], ['in', 'ter', 'na', 'tion', 'al'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin'], ['mar', 'gin'], ['of'], ['break', 'ing'], ['line']], 12, 1], ['justified', 'text of in-', 'ternational', 'internation-', 'al margin', 'margin of', 'breaking', 'line']), ('partial-repair probe', [[['lead', 'ing'], ['pa', 'ra', 'graph'], ['to'], ['mar', 'gin'], ['line'], ['jus', 'ti', 'fied']], 14, 3], ['leading para-', 'graph to mar-', 'gin line', 'justified']), ('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', [[['jus', 'ti', 'fied'], ['col', 'umn'], ['com', 'po', 'si', 'tion'], ['pa', 'ra', 'graph'], ['to'], ['jus', 'ti', 'fied'], ['mar', 'gin']], 12, 2], ['justified', 'column com-', 'position pa-', 'ragraph to', 'justified', 'margin']), ('control layout', [[['a'], ['kern', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting'], ['pa', 'ra', 'graph']], 11, 1], ['a kerning', 'interna-', 'tional', 'setting', 'paragraph'])], [('regression: whole-word fit test', [[['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']), ('regression: whole-word fit test', [[['col', 'umn'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing'], ['type'], ['lead', 'ing'], ['lead', 'ing'], ['text'], ['text'], ['pa', 'ra', 'graph']], 6, 1], ['column', 'inter-', 'national', 'kern-', 'ing', 'type', 'lead-', 'ing', 'lead-', 'ing', 'text', 'text', 'paragraph']), ('regression: whole-word fit test', [[['line'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin'], ['pa', 'ra', 'graph'], ['a'], ['a']], 7, 2], ['line', 'inter-', 'nation-', 'al', 'margin', 'para-', 'graph a', 'a']), ('regression: whole-word fit test', [[['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']), ('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', [[['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']), ('control layout', [[['a'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing'], ['col', 'umn'], ['col', 'umn'], ['lead', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['to'], ['break', 'ing'], ['jus', 'ti', 'fied']], 12, 1], ['a margin in-', 'ternational', 'kerning col-', 'umn column', 'leading in-', 'ternational', 'to breaking', 'justified'])], [('regression: whole-word fit test', [[['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: whole-word fit test', [[['type'], ['col', 'umn'], ['lead', 'ing'], ['lead', 'ing'], ['of'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al']], 10, 1], ['type col-', 'umn', 'leading', 'leading of', 'margin', 'international']), ('regression: whole-word fit test', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['type'], ['hy', 'phen', 'a', 'tion'], ['col', 'umn'], ['of'], ['pa', 'ra', 'graph'], ['hy', 'phen', 'a', 'tion']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'type', 'hyphen-', 'ation', 'column', 'of pa-', 'ragraph', 'hyphenation']), ('regression: whole-word fit test', [[['mar', 'gin'], ['pa', 'ra', 'graph'], ['lead', 'ing'], ['of'], ['type'], ['col', 'umn'], ['lead', 'ing']], 9, 3], ['margin', 'paragraph', 'leading', 'of type', 'column', 'leading']), ('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', [[['pa', 'ra', 'graph'], ['to'], ['jus', 'ti', 'fied'], ['lead', 'ing'], ['to'], ['col', 'umn']], 13, 2], ['paragraph to', 'justified', 'leading to', 'column']), ('control layout', [[['set', 'ting'], ['to'], ['break', 'ing'], ['com', 'po', 'si', 'tion'], ['lead', 'ing'], ['line'], ['jus', 'ti', 'fied'], ['a'], ['break', 'ing'], ['a'], ['line']], 13, 2], ['setting to', 'breaking com-', 'position', 'leading line', 'justified a', 'breaking a', 'line'])], [('regression: whole-word fit test', [[['line'], ['com', 'po', 'si', 'tion'], ['of'], ['to'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['pa', 'ra', 'graph'], ['hy', 'phen', 'a', 'tion'], ['set', 'ting']], 10, 3], ['line com-', 'position', 'of to in-', 'ternation-', 'al leading', 'paragraph', 'hyphena-', 'tion', 'setting']), ('regression: whole-word fit test', [[['lead', 'ing'], ['kern', 'ing'], ['hy', 'phen', 'a', 'tion'], ['kern', 'ing'], ['col', 'umn'], ['com', 'po', 'si', 'tion'], ['lead', 'ing'], ['text'], ['of'], ['jus', 'ti', 'fied'], ['type'], ['kern', 'ing']], 12, 1], ['leading', 'kerning hy-', 'phenation', 'kerning col-', 'umn', 'composition', 'leading text', 'of justified', 'type kerning']), ('partial-repair probe', [[['hy', 'phen', 'a', 'tion'], ['type'], ['mar', 'gin'], ['a'], ['jus', 'ti', 'fied'], ['col', 'umn'], ['break', 'ing'], ['com', 'po', 'si', 'tion'], ['line']], 12, 2], ['hyphenation', 'type margin', 'a justified', 'column', 'breaking', 'composition', 'line']), ('partial-repair probe', [[['type'], ['mar', 'gin'], ['of'], ['a'], ['col', 'umn']], 8, 3], ['type', 'margin', 'of a', 'column']), ('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', [[['col', 'umn'], ['kern', 'ing'], ['text'], ['col', 'umn'], ['line'], ['line'], ['a']], 12, 2], ['column kern-', 'ing text', 'column line', 'line 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-whole-word-fit-test","generated_at":"2026-09-29T14:49:49.573114+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.","root_cause":"The whole-word fit uses a strict < width comparison.","sha256":"4c40e3278a5d0c9f1fa073c7677a04c7163106c739bc2a7031ce9b42c58dba4d","title":"Consecutive hyphen limit: whole-word fit test · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":39.871,"exit_code":1,"observations":[{"actual":["leading","a jus-","tified","a a","para-","graph","setting","justified"],"check":"regression: whole-word fit test","expected":["lead-","ing a","justi-","fied a","a pa-","ragraph","set-","ting","justified"],"passed":false},{"actual":["leading kerning","composition","text leading","kerning hy-","phenation","hyphenation a","text paragraph"],"check":"regression: whole-word fit test","expected":["leading kern-","ing","composition","text leading","kerning hy-","phenation","hyphenation a","text paragraph"],"passed":false},{"actual":["breaking","kerning set-","ting breaking","hyphenation","leading to","line","justified"],"check":"partial-repair probe","expected":["breaking","kerning set-","ting","breaking hy-","phenation","leading to","line","justified"],"passed":false},{"actual":["to line compo-","sition margin","margin type","kerning inter-","national column","line composi-","tion to"],"check":"regression: whole-word fit test","expected":["to line compo-","sition margin","margin type","kerning inter-","national","column line","composition to"],"passed":false},{"actual":["inter-","national","compo-","sition","hyphen-","ation","text"],"check":"ladder of three hyphenated lines","expected":["inter-","nation-","al","compo-","sition","hyphen-","ation","text"],"passed":false},{"actual":["a","composition"],"check":"last word never hyphenated","expected":["a","composition"],"passed":true},{"actual":["interna-","tional","hyphena-","tion a","hyphena-","tion","breaking"],"check":"control layout","expected":["interna-","tional","hyphena-","tion a","hyphena-","tion","breaking"],"passed":true},{"actual":["text line hy-","phenation in-","ternational","composition","setting"],"check":"control layout","expected":["text line hy-","phenation in-","ternational","composition","setting"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: whole-word fit test\", \"actual\": [\"leading\", \"a jus-\", \"tified\", \"a a\", \"para-\", \"graph\", \"setting\", \"justified\"], \"expected\": [\"lead-\", \"ing a\", \"justi-\", \"fied a\", \"a pa-\", \"ragraph\", \"set-\", \"ting\", \"justified\"], \"passed\": false}, {\"check\": \"regression: whole-word fit test\", \"actual\": [\"leading kerning\", \"composition\", \"text leading\", \"kerning hy-\", \"phenation\", \"hyphenation a\", \"text paragraph\"], \"expected\": [\"leading kern-\", \"ing\", \"composition\", \"text leading\", \"kerning hy-\", \"phenation\", \"hyphenation a\", \"text paragraph\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"breaking\", \"kerning set-\", \"ting breaking\", \"hyphenation\", \"leading to\", \"line\", \"justified\"], \"expected\": [\"breaking\", \"kerning set-\", \"ting\", \"breaking hy-\", \"phenation\", \"leading to\", \"line\", \"justified\"], \"passed\": false}, {\"check\": \"regression: whole-word fit test\", \"actual\": [\"to line compo-\", \"sition margin\", \"margin type\", \"kerning inter-\", \"national column\", \"line composi-\", \"tion to\"], \"expected\": [\"to line compo-\", \"sition margin\", \"margin type\", \"kerning inter-\", \"national\", \"column line\", \"composition to\"], \"passed\": false}, {\"check\": \"ladder of three hyphenated lines\", \"actual\": [\"inter-\", \"national\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"text\"], \"expected\": [\"inter-\", \"nation-\", \"al\", \"compo-\", \"sition\", \"hyphen-\", \"ation\", \"text\"], \"passed\": false}, {\"check\": \"last word never hyphenated\", \"actual\": [\"a\", \"composition\"], \"expected\": [\"a\", \"composition\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"interna-\", \"tional\", \"hyphena-\", \"tion a\", \"hyphena-\", \"tion\", \"breaking\"], \"expected\": [\"interna-\", \"tional\", \"hyphena-\", \"tion a\", \"hyphena-\", \"tion\", \"breaking\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"text line hy-\", \"phenation in-\", \"ternational\", \"composition\", \"setting\"], \"expected\": [\"text line hy-\", \"phenation in-\", \"ternational\", \"composition\", \"setting\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.955,"exit_code":1,"observations":[{"actual":["lead-","ing a","justi-","fied","a a","para-","graph","set-","ting","justified"],"check":"regression: whole-word fit test","expected":["lead-","ing a","justi-","fied a","a pa-","ragraph","set-","ting","justified"],"passed":false},{"actual":["leading kern-","ing","composition","text leading","kerning hy-","phenation","hyphenation a","text","paragraph"],"check":"regression: whole-word fit test","expected":["leading kern-","ing","composition","text leading","kerning hy-","phenation","hyphenation a","text paragraph"],"passed":false},{"actual":["breaking","kerning set-","ting","breaking hy-","phenation","leading to","line","justified"],"check":"partial-repair probe","expected":["breaking","kerning set-","ting","breaking hy-","phenation","leading to","line","justified"],"passed":true},{"actual":["to line compo-","sition margin","margin type","kerning inter-","national","column line","composition","to"],"check":"regression: whole-word fit test","expected":["to line compo-","sition margin","margin type","kerning inter-","national","column line","composition to"],"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":["a","composition"],"check":"last word never hyphenated","expected":["a","composition"],"passed":true},{"actual":["interna-","tional","hyphena-","tion a","hyphena-","tion","breaking"],"check":"control layout","expected":["interna-","tional","hyphena-","tion a","hyphena-","tion","breaking"],"passed":true},{"actual":["text line hy-","phenation in-","ternational","composition","setting"],"check":"control layout","expected":["text line hy-","phenation in-","ternational","composition","setting"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: whole-word fit test\", \"actual\": [\"lead-\", \"ing a\", \"justi-\", \"fied\", \"a a\", \"para-\", \"graph\", \"set-\", \"ting\", \"justified\"], \"expected\": [\"lead-\", \"ing a\", \"justi-\", \"fied a\", \"a pa-\", \"ragraph\", \"set-\", \"ting\", \"justified\"], \"passed\": false}, {\"check\": \"regression: whole-word fit test\", \"actual\": [\"leading kern-\", \"ing\", \"composition\", \"text leading\", \"kerning hy-\", \"phenation\", \"hyphenation a\", \"text\", \"paragraph\"], \"expected\": [\"leading kern-\", \"ing\", \"composition\", \"text leading\", \"kerning hy-\", \"phenation\", \"hyphenation a\", \"text paragraph\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"breaking\", \"kerning set-\", \"ting\", \"breaking hy-\", \"phenation\", \"leading to\", \"line\", \"justified\"], \"expected\": [\"breaking\", \"kerning set-\", \"ting\", \"breaking hy-\", \"phenation\", \"leading to\", \"line\", \"justified\"], \"passed\": true}, {\"check\": \"regression: whole-word fit test\", \"actual\": [\"to line compo-\", \"sition margin\", \"margin type\", \"kerning inter-\", \"national\", \"column line\", \"composition\", \"to\"], \"expected\": [\"to line compo-\", \"sition margin\", \"margin type\", \"kerning inter-\", \"national\", \"column line\", \"composition to\"], \"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\": \"last word never hyphenated\", \"actual\": [\"a\", \"composition\"], \"expected\": [\"a\", \"composition\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"interna-\", \"tional\", \"hyphena-\", \"tion a\", \"hyphena-\", \"tion\", \"breaking\"], \"expected\": [\"interna-\", \"tional\", \"hyphena-\", \"tion a\", \"hyphena-\", \"tion\", \"breaking\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"text line hy-\", \"phenation in-\", \"ternational\", \"composition\", \"setting\"], \"expected\": [\"text line hy-\", \"phenation in-\", \"ternational\", \"composition\", \"setting\"], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}