{"abstract":"Words with internal capitals are protected, or proper names are hyphenated.","category":"Typography line breaking","checks":8,"contract":"Input [words as syllables, width, zone, min word length, min chars before, min chars after, hyphenate capitals]. Greedy fill. A word that does not fit may be hyphenated only if the slack left on the line (width minus current text minus the separating space) is at least the zone, the word has at least min-word characters, and (capitals allowed or its first letter is not uppercase). Pick the latest syllable boundary with head >= min before and tail >= min after chars whose head plus \"-\" fits. Return lines.","contract_signature":"x","evaluation_group":"w2-typography-line-breaking-hyphenation-zone","failed_approach":"Using istitle misclassifies names like McDonald.","family":"w2-typography-line-breaking-hyphenation-zone-capitalisation-test","id":"FA-80221","implementations":{"attempt":{"sha256":"af66fe6249dd91e9045574d6b529e6815cad6fbbc086bcc37a4b83d9a208936f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    words, width, zone, min_word, min_before, min_after, caps = x\n    lines = []\n    cur = ''\n    k = 0\n    queue = [list(w) for w in words]\n    while k < len(queue):\n        syl = queue[k]\n        token = ''.join(syl)\n        cand = token if not cur else cur + ' ' + token\n        if len(cand) <= width:\n            cur = cand\n            k += 1\n            continue\n        slack = width - len(cur) - (1 if cur else 0)\n        eligible = slack >= zone and len(token) >= min_word and (caps or not token.istitle())\n        cut = None\n        if eligible:\n            for c in range(len(syl) - 1, 0, -1):\n                head = ''.join(syl[:c])\n                tail = ''.join(syl[c:])\n                if len(head) < min_before or len(tail) < min_after:\n                    continue\n                fit = len(head) + 1 if not cur else len(cur) + len(head) + 2\n                if fit <= width:\n                    cut = c\n                    break\n        if cut is not None:\n            head = ''.join(syl[:cut]) + '-'\n            lines.append(head if not cur else cur + ' ' + head)\n            queue[k] = syl[cut:]\n            cur = ''\n        elif cur:\n            lines.append(cur)\n            cur = ''\n        else:\n            cur = token\n            k += 1\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: capitalisation test', [[['hy', 'phen', 'at', 'ed'], ['e', 'Book', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['the'], ['of'], ['Ber', 'lin'], ['a']], 15, 3, 5, 1, 3, False], ['hyphenated e-', 'Booking inter-', 'national the of', 'Berlin a']), ('regression: capitalisation test', [[['im', 'por', 'tant'], ['of'], ['on', 'ly'], ['ty', 'po', 'gra', 'phy'], ['e', 'Book', 'ing']], 12, 3, 5, 1, 2, False], ['important of', 'only typo-', 'graphy e-', 'Booking']), ('partial-repair probe', [[['on', 'ly'], ['a'], ['set'], ['on', 'ly'], ['on', 'ly'], ['a'], ['rag', 'ged'], ['Mc', 'Don', 'ald'], ['the'], ['Ber', 'lin']], 13, 1, 7, 2, 3, False], ['only a set', 'only only a', 'ragged', 'McDonald the', 'Berlin']), ('partial-repair probe', [[['set'], ['Mc', 'Don', 'ald'], ['in', 'ter', 'na', 'tion', 'al'], ['set'], ['of'], ['set'], ['Mc', 'Don', 'ald'], ['on', 'ly'], ['rag', 'ged'], ['in', 'ter', 'na', 'tion', 'al']], 8, 1, 7, 2, 2, False], ['set', 'McDonald', 'interna-', 'tional', 'set of', 'set', 'McDonald', 'only', 'ragged', 'interna-', 'tional']), ('capitalised word protected', [[['the'], ['Mc', 'Don', 'ald']], 10, 2, 4, 2, 2, False], ['the', 'McDonald']), ('zone exactly met', [[['the'], ['ty', 'po', 'gra', 'phy']], 10, 6, 4, 2, 2, False], ['the typo-', 'graphy']), ('control layout', [[['Ber', 'lin'], ['a'], ['hy', 'phen', 'at', 'ed'], ['rag', 'ged'], ['in', 'ter', 'na', 'tion', 'al'], ['rag', 'ged'], ['of'], ['a'], ['a']], 16, 5, 7, 1, 2, False], ['Berlin a hyphen-', 'ated ragged', 'international', 'ragged of a a']), ('control layout', [[['e', 'Book', 'ing'], ['of'], ['a'], ['e', 'Book', 'ing'], ['a'], ['of'], ['the'], ['set']], 11, 3, 7, 2, 2, False], ['eBooking of', 'a eBooking', 'a of the', 'set'])], [('regression: capitalisation test', [[['Ber', 'lin'], ['e', 'Book', 'ing'], ['rag', 'ged'], ['hy', 'phen', 'at', 'ed']], 13, 3, 7, 3, 3, False], ['Berlin eBook-', 'ing ragged', 'hyphenated']), ('regression: capitalisation test', [[['Mc', 'Don', 'ald'], ['e', 'Book', 'ing'], ['Ber', 'lin'], ['e', 'Book', 'ing']], 13, 4, 5, 3, 3, False], ['McDonald', 'eBooking', 'Berlin eBook-', 'ing']), ('partial-repair probe', [[['the'], ['Mc', 'Don', 'ald'], ['of'], ['of'], ['hy', 'phen', 'at', 'ed'], ['ty', 'po', 'gra', 'phy'], ['set'], ['Mc', 'Don', 'ald']], 8, 2, 6, 2, 2, False], ['the', 'McDonald', 'of of', 'hyphen-', 'ated ty-', 'pography', 'set', 'McDonald']), ('partial-repair probe', [[['of'], ['set'], ['a'], ['of'], ['Mc', 'Don', 'ald'], ['on', 'ly'], ['ty', 'po', 'gra', 'phy']], 9, 5, 4, 3, 3, False], ['of set a', 'of', 'McDonald', 'only', 'typogra-', 'phy']), ('capitalised word protected', [[['the'], ['Mc', 'Don', 'ald']], 10, 2, 4, 2, 2, False], ['the', 'McDonald']), ('zone exactly met', [[['the'], ['ty', 'po', 'gra', 'phy']], 10, 6, 4, 2, 2, False], ['the typo-', 'graphy']), ('control layout', [[['on', 'ly'], ['hy', 'phen', 'at', 'ed'], ['e', 'Book', 'ing'], ['Mc', 'Don', 'ald']], 13, 5, 7, 1, 2, True], ['only hyphen-', 'ated eBooking', 'McDonald']), ('control layout', [[['set'], ['Ber', 'lin'], ['on', 'ly'], ['e', 'Book', 'ing'], ['the'], ['the'], ['a'], ['Mc', 'Don', 'ald'], ['of']], 16, 4, 7, 2, 2, True], ['set Berlin only', 'eBooking the the', 'a McDonald of'])], [('regression: capitalisation test', [[['on', 'ly'], ['a'], ['e', 'Book', 'ing'], ['hy', 'phen', 'at', 'ed'], ['rag', 'ged'], ['Ber', 'lin'], ['Mc', 'Don', 'ald']], 14, 1, 7, 3, 3, False], ['only a eBook-', 'ing hyphenated', 'ragged Berlin', 'McDonald']), ('regression: capitalisation test', [[['ty', 'po', 'gra', 'phy'], ['e', 'Book', 'ing'], ['e', 'Book', 'ing'], ['im', 'por', 'tant'], ['im', 'por', 'tant'], ['in', 'ter', 'na', 'tion', 'al']], 12, 2, 4, 1, 3, False], ['typography', 'eBooking e-', 'Booking im-', 'portant im-', 'portant in-', 'ternational']), ('partial-repair probe', [[['the'], ['Mc', 'Don', 'ald'], ['Ber', 'lin'], ['a'], ['Ber', 'lin'], ['a'], ['a'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'at', 'ed'], ['ty', 'po', 'gra', 'phy']], 11, 5, 5, 2, 2, False], ['the', 'McDonald', 'Berlin a', 'Berlin a a', 'interna-', 'tional', 'hyphenated', 'typography']), ('partial-repair probe', [[['Mc', 'Don', 'ald'], ['of'], ['Mc', 'Don', 'ald'], ['ty', 'po', 'gra', 'phy'], ['set']], 10, 1, 6, 1, 2, False], ['McDonald', 'of', 'McDonald', 'typography', 'set']), ('capitalised word protected', [[['the'], ['Mc', 'Don', 'ald']], 10, 2, 4, 2, 2, False], ['the', 'McDonald']), ('zone exactly met', [[['the'], ['ty', 'po', 'gra', 'phy']], 10, 6, 4, 2, 2, False], ['the typo-', 'graphy']), ('control layout', [[['rag', 'ged'], ['ty', 'po', 'gra', 'phy'], ['Ber', 'lin'], ['e', 'Book', 'ing'], ['rag', 'ged'], ['rag', 'ged'], ['e', 'Book', 'ing']], 14, 5, 6, 2, 3, True], ['ragged typo-', 'graphy Berlin', 'eBooking rag-', 'ged ragged', 'eBooking']), ('control layout', [[['im', 'por', 'tant'], ['ty', 'po', 'gra', 'phy'], ['hy', 'phen', 'at', 'ed'], ['im', 'por', 'tant'], ['Ber', 'lin'], ['im', 'por', 'tant'], ['set'], ['e', 'Book', 'ing']], 12, 5, 4, 2, 2, True], ['important', 'typography', 'hyphenated', 'important', 'Berlin im-', 'portant set', 'eBooking'])], [('regression: capitalisation test', [[['set'], ['ty', 'po', 'gra', 'phy'], ['hy', 'phen', 'at', 'ed'], ['im', 'por', 'tant'], ['of'], ['Ber', 'lin'], ['e', 'Book', 'ing'], ['set']], 14, 1, 5, 2, 3, False], ['set typography', 'hyphenated im-', 'portant of', 'Berlin eBook-', 'ing set']), ('regression: capitalisation test', [[['e', 'Book', 'ing'], ['hy', 'phen', 'at', 'ed'], ['e', 'Book', 'ing'], ['Mc', 'Don', 'ald'], ['Ber', 'lin'], ['in', 'ter', 'na', 'tion', 'al'], ['set'], ['Mc', 'Don', 'ald'], ['in', 'ter', 'na', 'tion', 'al']], 12, 1, 4, 1, 2, False], ['eBooking hy-', 'phenated e-', 'Booking', 'McDonald', 'Berlin in-', 'ternational', 'set McDonald', 'internation-', 'al']), ('partial-repair probe', [[['Ber', 'lin'], ['ty', 'po', 'gra', 'phy'], ['ty', 'po', 'gra', 'phy'], ['Mc', 'Don', 'ald'], ['a'], ['of'], ['on', 'ly']], 12, 2, 7, 2, 3, False], ['Berlin typo-', 'graphy typo-', 'graphy', 'McDonald a', 'of only']), ('partial-repair probe', [[['of'], ['set'], ['a'], ['of'], ['Mc', 'Don', 'ald'], ['on', 'ly'], ['ty', 'po', 'gra', 'phy']], 9, 5, 4, 3, 3, False], ['of set a', 'of', 'McDonald', 'only', 'typogra-', 'phy']), ('capitalised word protected', [[['the'], ['Mc', 'Don', 'ald']], 10, 2, 4, 2, 2, False], ['the', 'McDonald']), ('zone exactly met', [[['the'], ['ty', 'po', 'gra', 'phy']], 10, 6, 4, 2, 2, False], ['the typo-', 'graphy']), ('control layout', [[['in', 'ter', 'na', 'tion', 'al'], ['set'], ['of'], ['on', 'ly'], ['e', 'Book', 'ing']], 11, 5, 5, 3, 3, False], ['interna-', 'tional set', 'of only', 'eBooking']), ('control layout', [[['Ber', 'lin'], ['e', 'Book', 'ing'], ['Ber', 'lin'], ['im', 'por', 'tant'], ['ty', 'po', 'gra', 'phy'], ['set'], ['a'], ['of'], ['rag', 'ged']], 10, 2, 7, 1, 2, True], ['Berlin e-', 'Booking', 'Berlin im-', 'portant', 'typography', 'set a of', 'ragged'])], [('regression: capitalisation test', [[['on', 'ly'], ['e', 'Book', 'ing'], ['a'], ['im', 'por', 'tant'], ['a'], ['the'], ['Ber', 'lin']], 12, 3, 7, 2, 3, False], ['only eBook-', 'ing a impor-', 'tant a the', 'Berlin']), ('regression: capitalisation test', [[['rag', 'ged'], ['in', 'ter', 'na', 'tion', 'al'], ['set'], ['hy', 'phen', 'at', 'ed'], ['of'], ['Ber', 'lin'], ['e', 'Book', 'ing']], 14, 4, 6, 3, 3, False], ['ragged inter-', 'national set', 'hyphenated of', 'Berlin eBook-', 'ing']), ('partial-repair probe', [[['Mc', 'Don', 'ald'], ['set'], ['on', 'ly'], ['hy', 'phen', 'at', 'ed'], ['hy', 'phen', 'at', 'ed'], ['a'], ['a'], ['the'], ['Mc', 'Don', 'ald']], 11, 3, 4, 2, 3, False], ['McDonald', 'set only', 'hyphenated', 'hyphenated', 'a a the', 'McDonald']), ('partial-repair probe', [[['a'], ['im', 'por', 'tant'], ['the'], ['of'], ['Mc', 'Don', 'ald'], ['the'], ['in', 'ter', 'na', 'tion', 'al']], 11, 3, 4, 1, 3, False], ['a important', 'the of', 'McDonald', 'the inter-', 'national']), ('capitalised word protected', [[['the'], ['Mc', 'Don', 'ald']], 10, 2, 4, 2, 2, False], ['the', 'McDonald']), ('zone exactly met', [[['the'], ['ty', 'po', 'gra', 'phy']], 10, 6, 4, 2, 2, False], ['the typo-', 'graphy']), ('control layout', [[['set'], ['im', 'por', 'tant'], ['im', 'por', 'tant'], ['in', 'ter', 'na', 'tion', 'al'], ['Mc', 'Don', 'ald'], ['set']], 16, 5, 4, 2, 2, True], ['set important', 'important inter-', 'national McDon-', 'ald set']), ('control layout', [[['set'], ['in', 'ter', 'na', 'tion', 'al'], ['rag', 'ged'], ['on', 'ly']], 12, 3, 6, 2, 3, True], ['set interna-', 'tional rag-', 'ged only'])]]\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":"137ad759a975f6db95048ad28ac884d28e955992d3b3aae6a57ca966c1a04c36","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    words, width, zone, min_word, min_before, min_after, caps = x\n    lines = []\n    cur = ''\n    k = 0\n    queue = [list(w) for w in words]\n    while k < len(queue):\n        syl = queue[k]\n        token = ''.join(syl)\n        cand = token if not cur else cur + ' ' + token\n        if len(cand) <= width:\n            cur = cand\n            k += 1\n            continue\n        slack = width - len(cur) - (1 if cur else 0)\n        eligible = slack >= zone and len(token) >= min_word and (caps or not any(ch.isupper() for ch in token))\n        cut = None\n        if eligible:\n            for c in range(len(syl) - 1, 0, -1):\n                head = ''.join(syl[:c])\n                tail = ''.join(syl[c:])\n                if len(head) < min_before or len(tail) < min_after:\n                    continue\n                fit = len(head) + 1 if not cur else len(cur) + len(head) + 2\n                if fit <= width:\n                    cut = c\n                    break\n        if cut is not None:\n            head = ''.join(syl[:cut]) + '-'\n            lines.append(head if not cur else cur + ' ' + head)\n            queue[k] = syl[cut:]\n            cur = ''\n        elif cur:\n            lines.append(cur)\n            cur = ''\n        else:\n            cur = token\n            k += 1\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: capitalisation test', [[['hy', 'phen', 'at', 'ed'], ['e', 'Book', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['the'], ['of'], ['Ber', 'lin'], ['a']], 15, 3, 5, 1, 3, False], ['hyphenated e-', 'Booking inter-', 'national the of', 'Berlin a']), ('regression: capitalisation test', [[['im', 'por', 'tant'], ['of'], ['on', 'ly'], ['ty', 'po', 'gra', 'phy'], ['e', 'Book', 'ing']], 12, 3, 5, 1, 2, False], ['important of', 'only typo-', 'graphy e-', 'Booking']), ('partial-repair probe', [[['on', 'ly'], ['a'], ['set'], ['on', 'ly'], ['on', 'ly'], ['a'], ['rag', 'ged'], ['Mc', 'Don', 'ald'], ['the'], ['Ber', 'lin']], 13, 1, 7, 2, 3, False], ['only a set', 'only only a', 'ragged', 'McDonald the', 'Berlin']), ('partial-repair probe', [[['set'], ['Mc', 'Don', 'ald'], ['in', 'ter', 'na', 'tion', 'al'], ['set'], ['of'], ['set'], ['Mc', 'Don', 'ald'], ['on', 'ly'], ['rag', 'ged'], ['in', 'ter', 'na', 'tion', 'al']], 8, 1, 7, 2, 2, False], ['set', 'McDonald', 'interna-', 'tional', 'set of', 'set', 'McDonald', 'only', 'ragged', 'interna-', 'tional']), ('capitalised word protected', [[['the'], ['Mc', 'Don', 'ald']], 10, 2, 4, 2, 2, False], ['the', 'McDonald']), ('zone exactly met', [[['the'], ['ty', 'po', 'gra', 'phy']], 10, 6, 4, 2, 2, False], ['the typo-', 'graphy']), ('control layout', [[['Ber', 'lin'], ['a'], ['hy', 'phen', 'at', 'ed'], ['rag', 'ged'], ['in', 'ter', 'na', 'tion', 'al'], ['rag', 'ged'], ['of'], ['a'], ['a']], 16, 5, 7, 1, 2, False], ['Berlin a hyphen-', 'ated ragged', 'international', 'ragged of a a']), ('control layout', [[['e', 'Book', 'ing'], ['of'], ['a'], ['e', 'Book', 'ing'], ['a'], ['of'], ['the'], ['set']], 11, 3, 7, 2, 2, False], ['eBooking of', 'a eBooking', 'a of the', 'set'])], [('regression: capitalisation test', [[['Ber', 'lin'], ['e', 'Book', 'ing'], ['rag', 'ged'], ['hy', 'phen', 'at', 'ed']], 13, 3, 7, 3, 3, False], ['Berlin eBook-', 'ing ragged', 'hyphenated']), ('regression: capitalisation test', [[['Mc', 'Don', 'ald'], ['e', 'Book', 'ing'], ['Ber', 'lin'], ['e', 'Book', 'ing']], 13, 4, 5, 3, 3, False], ['McDonald', 'eBooking', 'Berlin eBook-', 'ing']), ('partial-repair probe', [[['the'], ['Mc', 'Don', 'ald'], ['of'], ['of'], ['hy', 'phen', 'at', 'ed'], ['ty', 'po', 'gra', 'phy'], ['set'], ['Mc', 'Don', 'ald']], 8, 2, 6, 2, 2, False], ['the', 'McDonald', 'of of', 'hyphen-', 'ated ty-', 'pography', 'set', 'McDonald']), ('partial-repair probe', [[['of'], ['set'], ['a'], ['of'], ['Mc', 'Don', 'ald'], ['on', 'ly'], ['ty', 'po', 'gra', 'phy']], 9, 5, 4, 3, 3, False], ['of set a', 'of', 'McDonald', 'only', 'typogra-', 'phy']), ('capitalised word protected', [[['the'], ['Mc', 'Don', 'ald']], 10, 2, 4, 2, 2, False], ['the', 'McDonald']), ('zone exactly met', [[['the'], ['ty', 'po', 'gra', 'phy']], 10, 6, 4, 2, 2, False], ['the typo-', 'graphy']), ('control layout', [[['on', 'ly'], ['hy', 'phen', 'at', 'ed'], ['e', 'Book', 'ing'], ['Mc', 'Don', 'ald']], 13, 5, 7, 1, 2, True], ['only hyphen-', 'ated eBooking', 'McDonald']), ('control layout', [[['set'], ['Ber', 'lin'], ['on', 'ly'], ['e', 'Book', 'ing'], ['the'], ['the'], ['a'], ['Mc', 'Don', 'ald'], ['of']], 16, 4, 7, 2, 2, True], ['set Berlin only', 'eBooking the the', 'a McDonald of'])], [('regression: capitalisation test', [[['on', 'ly'], ['a'], ['e', 'Book', 'ing'], ['hy', 'phen', 'at', 'ed'], ['rag', 'ged'], ['Ber', 'lin'], ['Mc', 'Don', 'ald']], 14, 1, 7, 3, 3, False], ['only a eBook-', 'ing hyphenated', 'ragged Berlin', 'McDonald']), ('regression: capitalisation test', [[['ty', 'po', 'gra', 'phy'], ['e', 'Book', 'ing'], ['e', 'Book', 'ing'], ['im', 'por', 'tant'], ['im', 'por', 'tant'], ['in', 'ter', 'na', 'tion', 'al']], 12, 2, 4, 1, 3, False], ['typography', 'eBooking e-', 'Booking im-', 'portant im-', 'portant in-', 'ternational']), ('partial-repair probe', [[['the'], ['Mc', 'Don', 'ald'], ['Ber', 'lin'], ['a'], ['Ber', 'lin'], ['a'], ['a'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'at', 'ed'], ['ty', 'po', 'gra', 'phy']], 11, 5, 5, 2, 2, False], ['the', 'McDonald', 'Berlin a', 'Berlin a a', 'interna-', 'tional', 'hyphenated', 'typography']), ('partial-repair probe', [[['Mc', 'Don', 'ald'], ['of'], ['Mc', 'Don', 'ald'], ['ty', 'po', 'gra', 'phy'], ['set']], 10, 1, 6, 1, 2, False], ['McDonald', 'of', 'McDonald', 'typography', 'set']), ('capitalised word protected', [[['the'], ['Mc', 'Don', 'ald']], 10, 2, 4, 2, 2, False], ['the', 'McDonald']), ('zone exactly met', [[['the'], ['ty', 'po', 'gra', 'phy']], 10, 6, 4, 2, 2, False], ['the typo-', 'graphy']), ('control layout', [[['rag', 'ged'], ['ty', 'po', 'gra', 'phy'], ['Ber', 'lin'], ['e', 'Book', 'ing'], ['rag', 'ged'], ['rag', 'ged'], ['e', 'Book', 'ing']], 14, 5, 6, 2, 3, True], ['ragged typo-', 'graphy Berlin', 'eBooking rag-', 'ged ragged', 'eBooking']), ('control layout', [[['im', 'por', 'tant'], ['ty', 'po', 'gra', 'phy'], ['hy', 'phen', 'at', 'ed'], ['im', 'por', 'tant'], ['Ber', 'lin'], ['im', 'por', 'tant'], ['set'], ['e', 'Book', 'ing']], 12, 5, 4, 2, 2, True], ['important', 'typography', 'hyphenated', 'important', 'Berlin im-', 'portant set', 'eBooking'])], [('regression: capitalisation test', [[['set'], ['ty', 'po', 'gra', 'phy'], ['hy', 'phen', 'at', 'ed'], ['im', 'por', 'tant'], ['of'], ['Ber', 'lin'], ['e', 'Book', 'ing'], ['set']], 14, 1, 5, 2, 3, False], ['set typography', 'hyphenated im-', 'portant of', 'Berlin eBook-', 'ing set']), ('regression: capitalisation test', [[['e', 'Book', 'ing'], ['hy', 'phen', 'at', 'ed'], ['e', 'Book', 'ing'], ['Mc', 'Don', 'ald'], ['Ber', 'lin'], ['in', 'ter', 'na', 'tion', 'al'], ['set'], ['Mc', 'Don', 'ald'], ['in', 'ter', 'na', 'tion', 'al']], 12, 1, 4, 1, 2, False], ['eBooking hy-', 'phenated e-', 'Booking', 'McDonald', 'Berlin in-', 'ternational', 'set McDonald', 'internation-', 'al']), ('partial-repair probe', [[['Ber', 'lin'], ['ty', 'po', 'gra', 'phy'], ['ty', 'po', 'gra', 'phy'], ['Mc', 'Don', 'ald'], ['a'], ['of'], ['on', 'ly']], 12, 2, 7, 2, 3, False], ['Berlin typo-', 'graphy typo-', 'graphy', 'McDonald a', 'of only']), ('partial-repair probe', [[['of'], ['set'], ['a'], ['of'], ['Mc', 'Don', 'ald'], ['on', 'ly'], ['ty', 'po', 'gra', 'phy']], 9, 5, 4, 3, 3, False], ['of set a', 'of', 'McDonald', 'only', 'typogra-', 'phy']), ('capitalised word protected', [[['the'], ['Mc', 'Don', 'ald']], 10, 2, 4, 2, 2, False], ['the', 'McDonald']), ('zone exactly met', [[['the'], ['ty', 'po', 'gra', 'phy']], 10, 6, 4, 2, 2, False], ['the typo-', 'graphy']), ('control layout', [[['in', 'ter', 'na', 'tion', 'al'], ['set'], ['of'], ['on', 'ly'], ['e', 'Book', 'ing']], 11, 5, 5, 3, 3, False], ['interna-', 'tional set', 'of only', 'eBooking']), ('control layout', [[['Ber', 'lin'], ['e', 'Book', 'ing'], ['Ber', 'lin'], ['im', 'por', 'tant'], ['ty', 'po', 'gra', 'phy'], ['set'], ['a'], ['of'], ['rag', 'ged']], 10, 2, 7, 1, 2, True], ['Berlin e-', 'Booking', 'Berlin im-', 'portant', 'typography', 'set a of', 'ragged'])], [('regression: capitalisation test', [[['on', 'ly'], ['e', 'Book', 'ing'], ['a'], ['im', 'por', 'tant'], ['a'], ['the'], ['Ber', 'lin']], 12, 3, 7, 2, 3, False], ['only eBook-', 'ing a impor-', 'tant a the', 'Berlin']), ('regression: capitalisation test', [[['rag', 'ged'], ['in', 'ter', 'na', 'tion', 'al'], ['set'], ['hy', 'phen', 'at', 'ed'], ['of'], ['Ber', 'lin'], ['e', 'Book', 'ing']], 14, 4, 6, 3, 3, False], ['ragged inter-', 'national set', 'hyphenated of', 'Berlin eBook-', 'ing']), ('partial-repair probe', [[['Mc', 'Don', 'ald'], ['set'], ['on', 'ly'], ['hy', 'phen', 'at', 'ed'], ['hy', 'phen', 'at', 'ed'], ['a'], ['a'], ['the'], ['Mc', 'Don', 'ald']], 11, 3, 4, 2, 3, False], ['McDonald', 'set only', 'hyphenated', 'hyphenated', 'a a the', 'McDonald']), ('partial-repair probe', [[['a'], ['im', 'por', 'tant'], ['the'], ['of'], ['Mc', 'Don', 'ald'], ['the'], ['in', 'ter', 'na', 'tion', 'al']], 11, 3, 4, 1, 3, False], ['a important', 'the of', 'McDonald', 'the inter-', 'national']), ('capitalised word protected', [[['the'], ['Mc', 'Don', 'ald']], 10, 2, 4, 2, 2, False], ['the', 'McDonald']), ('zone exactly met', [[['the'], ['ty', 'po', 'gra', 'phy']], 10, 6, 4, 2, 2, False], ['the typo-', 'graphy']), ('control layout', [[['set'], ['im', 'por', 'tant'], ['im', 'por', 'tant'], ['in', 'ter', 'na', 'tion', 'al'], ['Mc', 'Don', 'ald'], ['set']], 16, 5, 4, 2, 2, True], ['set important', 'important inter-', 'national McDon-', 'ald set']), ('control layout', [[['set'], ['in', 'ter', 'na', 'tion', 'al'], ['rag', 'ged'], ['on', 'ly']], 12, 3, 6, 2, 3, True], ['set interna-', 'tional rag-', 'ged only'])]]\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-hyphenation-zone-capitalisation-test","generated_at":"2026-09-29T14:49:51.815408+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":"Capitalisation is detected by any uppercase letter instead of the first letter.","sha256":"e4e471a733916f6ec7b8ff6f619f8f61103953d6fdf7d1eb430de4e630817852","title":"Ragged-right hyphenation zone: capitalisation 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.588,"exit_code":1,"observations":[{"actual":["hyphenated e-","Booking inter-","national the of","Berlin a"],"check":"regression: capitalisation test","expected":["hyphenated e-","Booking inter-","national the of","Berlin a"],"passed":true},{"actual":["important of","only typo-","graphy e-","Booking"],"check":"regression: capitalisation test","expected":["important of","only typo-","graphy e-","Booking"],"passed":true},{"actual":["only a set","only only a","ragged McDon-","ald the","Berlin"],"check":"partial-repair probe","expected":["only a set","only only a","ragged","McDonald the","Berlin"],"passed":false},{"actual":["set Mc-","Donald","interna-","tional","set of","set Mc-","Donald","only","ragged","interna-","tional"],"check":"partial-repair probe","expected":["set","McDonald","interna-","tional","set of","set","McDonald","only","ragged","interna-","tional"],"passed":false},{"actual":["the McDon-","ald"],"check":"capitalised word protected","expected":["the","McDonald"],"passed":false},{"actual":["the typo-","graphy"],"check":"zone exactly met","expected":["the typo-","graphy"],"passed":true},{"actual":["Berlin a hyphen-","ated ragged","international","ragged of a a"],"check":"control layout","expected":["Berlin a hyphen-","ated ragged","international","ragged of a a"],"passed":true},{"actual":["eBooking of","a eBooking","a of the","set"],"check":"control layout","expected":["eBooking of","a eBooking","a of the","set"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: capitalisation test\", \"actual\": [\"hyphenated e-\", \"Booking inter-\", \"national the of\", \"Berlin a\"], \"expected\": [\"hyphenated e-\", \"Booking inter-\", \"national the of\", \"Berlin a\"], \"passed\": true}, {\"check\": \"regression: capitalisation test\", \"actual\": [\"important of\", \"only typo-\", \"graphy e-\", \"Booking\"], \"expected\": [\"important of\", \"only typo-\", \"graphy e-\", \"Booking\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"only a set\", \"only only a\", \"ragged McDon-\", \"ald the\", \"Berlin\"], \"expected\": [\"only a set\", \"only only a\", \"ragged\", \"McDonald the\", \"Berlin\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"set Mc-\", \"Donald\", \"interna-\", \"tional\", \"set of\", \"set Mc-\", \"Donald\", \"only\", \"ragged\", \"interna-\", \"tional\"], \"expected\": [\"set\", \"McDonald\", \"interna-\", \"tional\", \"set of\", \"set\", \"McDonald\", \"only\", \"ragged\", \"interna-\", \"tional\"], \"passed\": false}, {\"check\": \"capitalised word protected\", \"actual\": [\"the McDon-\", \"ald\"], \"expected\": [\"the\", \"McDonald\"], \"passed\": false}, {\"check\": \"zone exactly met\", \"actual\": [\"the typo-\", \"graphy\"], \"expected\": [\"the typo-\", \"graphy\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"Berlin a hyphen-\", \"ated ragged\", \"international\", \"ragged of a a\"], \"expected\": [\"Berlin a hyphen-\", \"ated ragged\", \"international\", \"ragged of a a\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"eBooking of\", \"a eBooking\", \"a of the\", \"set\"], \"expected\": [\"eBooking of\", \"a eBooking\", \"a of the\", \"set\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.741,"exit_code":1,"observations":[{"actual":["hyphenated","eBooking inter-","national the of","Berlin a"],"check":"regression: capitalisation test","expected":["hyphenated e-","Booking inter-","national the of","Berlin a"],"passed":false},{"actual":["important of","only typo-","graphy","eBooking"],"check":"regression: capitalisation test","expected":["important of","only typo-","graphy e-","Booking"],"passed":false},{"actual":["only a set","only only a","ragged","McDonald the","Berlin"],"check":"partial-repair probe","expected":["only a set","only only a","ragged","McDonald the","Berlin"],"passed":true},{"actual":["set","McDonald","interna-","tional","set of","set","McDonald","only","ragged","interna-","tional"],"check":"partial-repair probe","expected":["set","McDonald","interna-","tional","set of","set","McDonald","only","ragged","interna-","tional"],"passed":true},{"actual":["the","McDonald"],"check":"capitalised word protected","expected":["the","McDonald"],"passed":true},{"actual":["the typo-","graphy"],"check":"zone exactly met","expected":["the typo-","graphy"],"passed":true},{"actual":["Berlin a hyphen-","ated ragged","international","ragged of a a"],"check":"control layout","expected":["Berlin a hyphen-","ated ragged","international","ragged of a a"],"passed":true},{"actual":["eBooking of","a eBooking","a of the","set"],"check":"control layout","expected":["eBooking of","a eBooking","a of the","set"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: capitalisation test\", \"actual\": [\"hyphenated\", \"eBooking inter-\", \"national the of\", \"Berlin a\"], \"expected\": [\"hyphenated e-\", \"Booking inter-\", \"national the of\", \"Berlin a\"], \"passed\": false}, {\"check\": \"regression: capitalisation test\", \"actual\": [\"important of\", \"only typo-\", \"graphy\", \"eBooking\"], \"expected\": [\"important of\", \"only typo-\", \"graphy e-\", \"Booking\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"only a set\", \"only only a\", \"ragged\", \"McDonald the\", \"Berlin\"], \"expected\": [\"only a set\", \"only only a\", \"ragged\", \"McDonald the\", \"Berlin\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"set\", \"McDonald\", \"interna-\", \"tional\", \"set of\", \"set\", \"McDonald\", \"only\", \"ragged\", \"interna-\", \"tional\"], \"expected\": [\"set\", \"McDonald\", \"interna-\", \"tional\", \"set of\", \"set\", \"McDonald\", \"only\", \"ragged\", \"interna-\", \"tional\"], \"passed\": true}, {\"check\": \"capitalised word protected\", \"actual\": [\"the\", \"McDonald\"], \"expected\": [\"the\", \"McDonald\"], \"passed\": true}, {\"check\": \"zone exactly met\", \"actual\": [\"the typo-\", \"graphy\"], \"expected\": [\"the typo-\", \"graphy\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"Berlin a hyphen-\", \"ated ragged\", \"international\", \"ragged of a a\"], \"expected\": [\"Berlin a hyphen-\", \"ated ragged\", \"international\", \"ragged of a a\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"eBooking of\", \"a eBooking\", \"a of the\", \"set\"], \"expected\": [\"eBooking of\", \"a eBooking\", \"a of the\", \"set\"], \"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."}}