{"abstract":"The last legal hyphen before the word end is suppressed.","category":"Typography line breaking","checks":8,"contract":"Input [word, patterns, exceptions, lefthyphenmin, righthyphenmin]. An exception (hyphenated, lowercase) matching the lowercased word dictates the hyphens and keeps the word's own letters. Otherwise the lowercased word is padded with dots, every substring pattern contributes its digits and the maximum digit per gap wins; odd values allow a hyphen. A hyphen before letter i needs i>=lefthyphenmin and len-i>=righthyphenmin. Return the word with \"-\" inserted.","evaluation_group":"w2-typography-line-breaking-liang-patterns","failed_approach":"Relaxing to rmin - 1 permits too-short word tails.","family":"w2-typography-line-breaking-liang-patterns-right-hyphen-minimum","id":"FA-79931","implementations":{"attempt":{"sha256":"944fd35b46f8bd9c4a60ed8a0b559cce7a95c5c7c710ca88fe90b14f7c847dc7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    word, patterns, exceptions, lmin, rmin = x\n    low = word.lower()\n    for e in exceptions:\n        if e.replace('-', '') == low:\n            out, count = '', 0\n            for c in e:\n                if c == '-':\n                    out += '-'\n                else:\n                    out += word[count]\n                    count += 1\n            return out\n    table = {}\n    for p in patterns:\n        letters = ''\n        vals = [0]\n        for c in p:\n            if c.isdigit():\n                vals[-1] = int(c)\n            else:\n                letters += c\n                vals.append(0)\n        table[letters] = vals\n    dotted = '.' + low + '.'\n    score = [0] * (len(dotted) + 1)\n    for s in range(len(dotted)):\n        for e in range(s + 1, len(dotted) + 1):\n            vals = table.get(dotted[s:e])\n            if vals:\n                for k, v in enumerate(vals):\n                    score[s + k] = max(score[s + k], v)\n    points = [i for i in range(1, len(word)) if score[i + 1] % 2 == 1 and i >= lmin and len(word) - i >= rmin - 1]\n    out = ''\n    for i, c in enumerate(word):\n        if i in points:\n            out += '-'\n        out += c\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: right hyphen minimum', ['running', ['t1t', 'li1', 'b2l', 'm1m', '.un1', 'e2x', 'x1c', 'a2n', 'l1l', 'pu2', 's1s', 'n1g', 'o2n', 'hy3ph', '.re1', '2mp', 'gr2', '2io', '.ta4', '1m', 'at1', '1p', 'e1c', 'c2ce', '1tio', '5nd.', 'hena4', 'he2n', '1ble', 'ment1', '3ty.', 'p2h', 'ca1t', 'ter1', 'hen5at', 'om1', 'a1b', 'ex1', 'an1d', 'con1', '4ing.', 'r1r', '1na', '1q', '1ca', 'n2at', 'io3n.'], ['ex-cep-tion', 'ta-ble'], 2, 1], 'runnin-g'), ('regression: right hyphen minimum', ['Mississippi', ['1q', '1tio', 'n1g', 'e2x', 'ca1t', '1p', 'hen5at', 'hena4', 'gr2', 'n2at', 'an1d', 'x1c', 'ment1', 'r1r', 'io3n.', '.un1', '.re1', 'c2ce', '1ble', 'hy3ph', '3ty.', '5nd.', 'e1c', 't1t', 'pu2', '.ta4', 'm1m', 'b2l', 'o2n', 'a1b', 'li1', 'he2n', 's1s', '4ing.'], ['ex-cep-tion'], 1, 3], 'Mis-sis-si-ppi'), ('partial-repair probe', ['understand', ['io3n.', 'n1g', 'x1c', 'e1c', 'l1l', 'con1', 's1s', 'm1m', 'li1', '.re1', '2mp', 'ter1', '1ca', 'hena4', '5nd.', 'an1d', '3ty.', 'b2l', 't1t', 'ex1', 'c2ce', 'om1', '1tio', '4ing.', 'e2x', 'hy3ph', '1p', 'a1b', 'pu2', 'he2n', 'ment1', '1ble', 'gr2', 'hen5at', '.ta4', 'r1r', '.un1', '1m', 'n2at', 'ca1t', 'p2h', '1na', '2io', '1q'], ['ta-ble', 'gram-mar', 'ex-cep-tion'], 2, 3], 'un-derstand'), ('partial-repair probe', ['understand', ['ca1t', 'l1l', 'an1d', 'n2at', 'a2n', 'gr2', 'c2ce', '3ty.', '1m', 'r1r', '1na', '2mp', 'he2n', '4ing.', 'ter1', 'a1b', 'om1', 'e1c', 'hen5at', 'n1g', '1ca', 'm1m', '2io', 'b2l', '.un1', 'pu2', 'hena4', 'o2n', '1p'], ['mis-sis-sip-pi', 'ta-ble'], 3, 2], 'understand'), ('capitalised exception', ['Table', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], ['ta-ble'], 1, 1], 'Ta-ble'), ('right minimum boundary', ['category', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 1, 3], 'ca-t-egory'), ('control layout', ['connection', ['.un1', 'ment1', 'ter1', '.re1', '1m', '1q', 'a1b', 'hena4', 'e1c', 'm1m', '1ble', 'p2h', 'c2ce', 'o2n', 'n1g', 'pu2', 'e2x', '1tio', 'x1c', 'r1r', 's1s', 'om1', 'con1', 'ex1'], ['pro-ject', 'ta-ble'], 3, 1], 'con-ne-c-tion'), ('control layout', ['Exception', ['ex1', '2io', 'io3n.', 'x1c', 'pu2', 'at1', '1m', 'hy3ph', 'om1', 'n2at', '1na', '2mp', '1p', 'n1g', '1tio', '.un1', 'e1c', '.re1', 'c2ce', 'o2n', 'b2l', '1ca', 'l1l'], ['gram-mar', 'pro-ject', 'ex-cep-tion'], 3, 1], 'Ex-cep-tion')], [('regression: right hyphen minimum', ['running', ['e1c', 'at1', '5nd.', '1na', 'hena4', 'pu2', 'li1', 'r1r', '2mp', '.ta4', '2io', 'ment1', 'an1d', 't1t', 'p2h', '.re1', '1m', 'ter1', 'hy3ph', 'ex1', 'n2at', '1tio', 'om1', 'b2l', 'c2ce', '4ing.', 'io3n.', 'con1', 'a2n', 'gr2', '.un1', 'a1b', 'x1c', '1ca', 'o2n', 'm1m', 'n1g'], ['pro-ject', 'gram-mar', 'ta-ble'], 1, 1], 'runnin-g'), ('regression: right hyphen minimum', ['literally', ['n2at', 'c2ce', '1q', '5nd.', 'p2h', '1p', '2io', 'l1l', '1ble', 'con1', 'n1g', '.ta4', 'r1r', 'he2n', '4ing.', 'hen5at', '2mp', 's1s', 'om1', '3ty.', 'hy3ph', '.un1', 'x1c', 'io3n.', 'a1b', 'an1d', 't1t', '1tio', 'li1', 'm1m', '1ca', 'ex1', '1na', '.re1', 'at1', 'pu2', 'e1c', 'gr2', '1m'], [], 1, 2], 'li-teral-ly'), ('partial-repair probe', ['understand', ['ca1t', 'l1l', 'an1d', 'n2at', 'a2n', 'gr2', 'c2ce', '3ty.', '1m', 'r1r', '1na', '2mp', 'he2n', '4ing.', 'ter1', 'a1b', 'om1', 'e1c', 'hen5at', 'n1g', '1ca', 'm1m', '2io', 'b2l', '.un1', 'pu2', 'hena4', 'o2n', '1p'], ['mis-sis-sip-pi', 'ta-ble'], 3, 2], 'understand'), ('partial-repair probe', ['Paragraph', ['x1c', '1na', 'n1g', 'b2l', 'hen5at', '.un1', '.ta4', 'con1', '1q', 'a2n', 'hena4', 'gr2', 'a1b', 'm1m', 'r1r', '1ca', 'n2at', 'c2ce', 'e1c', '4ing.', '2io', 's1s', 'io3n.', 'ex1', 'hy3ph', 'an1d', 'o2n', '1p', 'he2n', 'om1', 't1t', '1m', '.re1', 'at1', 'li1', '1tio'], ['ta-ble', 'gram-mar'], 1, 3], 'Paragraph'), ('word-final pattern ing.', ['running', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 2, 2], 'running'), ('left minimum boundary', ['excellent', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 2, 3], 'ex-cel-lent'), ('control layout', ['project', ['hy3ph', 'x1c', '.un1', '.ta4', 'con1', 'ment1', 'pu2', 'l1l', 'ca1t', 'a2n', '3ty.', 'hen5at', 'e2x', 's1s', 'gr2', 'a1b', 'e1c', 'o2n', 'hena4', '1ca', 'c2ce', '1q', 'n1g', 't1t', 'io3n.', 'li1', '1p', '2mp', 'ex1', '4ing.', 'b2l', 'om1', '1ble', 'p2h', 'n2at', 'm1m', '.re1', '1na', '5nd.', 'an1d', '2io', 'ter1', '1m', 'he2n', '1tio'], ['pro-ject', 'ta-ble'], 1, 2], 'pro-ject'), ('control layout', ['computer', ['ment1', 'gr2', 'pu2', 'hy3ph', 'r1r', '2mp', 'o2n', 'c2ce', 'a2n', '2io', '.re1', 's1s', 'hen5at', '.un1', 'm1m', 'hena4', '4ing.', 'x1c', 'ex1', 'ca1t', 'a1b', 'io3n.', 'l1l', '5nd.', '1m', '3ty.', 'n2at', 'ter1', '1ble', '1q', '1p', 'b2l', 'li1', 'e1c', '1ca', 'he2n'], ['ta-ble'], 2, 3], 'com-puter')], [('regression: right hyphen minimum', ['grammar', ['1p', 'io3n.', 'r1r', '4ing.', 'li1', 'ca1t', 'e1c', '1m', 'ment1', '.ta4', 'hen5at', 'm1m', 'ex1', '.un1', 'at1', 'gr2', '1na', 'an1d', '3ty.', '.re1', 'l1l', '2mp', 'a2n', 'b2l', '2io', 'c2ce', 'n1g', 'he2n', 'o2n', '1ca', '1tio', '1q'], ['ta-ble', 'pro-ject'], 2, 3], 'gra-m-mar'), ('regression: right hyphen minimum', ['understand', ['b2l', '1ca', '1m', '1tio', '2mp', 'ment1', 't1t', '1p', '.ta4', 'li1', 'e1c', '1q', '4ing.', 'ex1', '5nd.', 'om1', 'o2n', 'hen5at', 'l1l', 'ter1', 'hena4', '.un1', 'r1r', 'pu2', 'p2h'], ['mis-sis-sip-pi'], 3, 2], 'understa-nd'), ('partial-repair probe', ['hyphenation', ['ter1', 'b2l', 'o2n', '5nd.', 'e1c', '.ta4', 'n1g', 'om1', 'hena4', 'pu2', 'l1l', 'a2n', 'r1r', 'hy3ph', 't1t', '.re1', '1p', 'e2x', '1q', 'ca1t', '3ty.', '2mp', '1m', 'ment1', '4ing.', 'x1c', '1ble', 'p2h', 'li1', 'c2ce', 'n2at', '2io', 'an1d', 'con1', 'io3n.', 'm1m', 'gr2', 'ex1', '1na'], ['gram-mar'], 2, 2], 'hy-phe-nation'), ('partial-repair probe', ['Paragraph', ['1na', '1ca', '2io', '3ty.', 'p2h', '1p', '.un1', 'a1b', 'an1d', 'li1', 'io3n.', '1m', 'a2n', 'n1g'], [], 1, 3], 'Paragraph'), ('lowercase exception', ['project', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], ['pro-ject'], 2, 3], 'pro-ject'), ('capitalised exception', ['Table', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], ['ta-ble'], 1, 1], 'Ta-ble'), ('control layout', ['Paragraph', ['1m', '2mp', '.ta4', 'hy3ph', 'pu2', 'e2x', 'om1', '1tio', 'at1', '.un1', 'n2at', '1na', 'hena4', 'r1r', 'ca1t', '1q', '2io', '.re1', 'a2n', 'n1g', 'o2n', 'ter1', 'l1l', 'x1c', 'p2h', 'con1', '5nd.', 'he2n', '4ing.', 'b2l', 'm1m', '1ble', '1p', 'c2ce', 's1s'], ['gram-mar', 'pro-ject'], 3, 1], 'Paragra-ph'), ('control layout', ['Recreation', ['li1', 'an1d', 'at1', '1ble', 'io3n.', 'a2n', 'e2x', '1tio', '.un1', '3ty.', 'r1r', '2io', 'e1c', 'he2n', '1m', 'om1', 'hen5at', '.ta4', 'n1g', 'a1b', 'ment1', 'p2h', '4ing.', '.re1', '1na', 'b2l', 'c2ce', 't1t'], ['mis-sis-sip-pi', 'ex-cep-tion'], 2, 3], 'Re-crea-tion')], [('regression: right hyphen minimum', ['understand', ['hy3ph', 'ex1', 'p2h', 'e2x', 'm1m', 'hena4', 'an1d', '4ing.', 't1t', 'hen5at', 'a1b', 's1s', 'l1l', '.un1', 'n2at'], ['mis-sis-sip-pi', 'ex-cep-tion', 'pro-ject'], 2, 1], 'un-derstan-d'), ('regression: right hyphen minimum', ['Mississippi', ['5nd.', 'n2at', 'hena4', 'r1r', 'om1', 'e2x', 'hy3ph', 'an1d', '1p', 't1t', 'o2n', '.ta4', 'n1g', 'x1c', 'ter1', 's1s', 'li1', 'gr2', '2mp', '3ty.', 'p2h', 'c2ce', 'ex1', 'l1l', 'm1m', 'at1', 'a2n', '1ble', '4ing.', 'io3n.', '1tio', 'pu2', 'ca1t', '1m', 'a1b', 'con1', '.un1'], [], 1, 2], 'Mis-sis-si-p-pi'), ('partial-repair probe', ['Paragraph', ['s1s', 'io3n.', 'ca1t', 'x1c', 'hen5at', '.un1', '2mp', '4ing.', 'l1l', '1m', '1tio', 'gr2', 'b2l', '3ty.', 't1t', 'a1b', 'e1c', 'c2ce', 'pu2', 'ter1', 'o2n', '1q', 'r1r', '1p', 'm1m', 'n2at'], ['pro-ject'], 3, 3], 'Paragraph'), ('partial-repair probe', ['typesetting', ['he2n', '5nd.', 'x1c', '2mp', 'e1c', 'ment1', 'p2h', 'ca1t', 'a2n', 'hena4', '1tio', '.re1', 'gr2', 'hen5at', 'hy3ph', 'ex1', 'an1d', 'pu2', 'm1m', 't1t', '1ble', '1ca', 'b2l', 'n1g', '2io', 'r1r', '.un1', 'o2n', '4ing.', '.ta4', '1p', '3ty.', 'io3n.', 'e2x', 's1s', '1m', 'l1l', '1na', 'ter1'], [], 3, 2], 'typeset-ting'), ('left minimum boundary', ['excellent', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 2, 3], 'ex-cel-lent'), ('right minimum boundary', ['category', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 1, 3], 'ca-t-egory'), ('control layout', ['Unexpected', ['1m', '1tio', 'ment1', 'm1m', 'c2ce', 'r1r', '1ca', '4ing.'], [], 1, 3], 'Unexpected'), ('control layout', ['battle', ['m1m', '3ty.', 'at1', '.un1', '2io', 'c2ce', '.ta4', 'gr2', 'an1d', '5nd.', 'a2n', 'he2n', 'p2h', 'li1', 'io3n.', '2mp', '4ing.', 't1t', '.re1', 'x1c', '1q', 'hena4', 'con1', 'n1g', 'a1b', 'n2at', 'e2x', 'om1', 'l1l', 'ter1', 'o2n', '1m', '1ble', 'ment1', '1p', 's1s', 'b2l', '1tio', '1ca', 'e1c', 'hy3ph', 'r1r', 'ex1', 'ca1t'], ['mis-sis-sip-pi', 'pro-ject'], 3, 2], 'bat-tle')], [('regression: right hyphen minimum', ['hyphenation', ['a2n', 'at1', 'e1c', '1tio', 'p2h', 'n2at', 'gr2', 'pu2', '.re1', 'an1d', 'ca1t', 'e2x', 't1t', 'l1l', '1ca', 'n1g', '1p', 'li1', '3ty.', 'hy3ph', '5nd.', '.un1', 'c2ce', '.ta4', 'om1', '1na'], ['pro-ject', 'gram-mar'], 1, 3], 'hy-phe-na-t-ion'), ('regression: right hyphen minimum', ['hyphenation', ['5nd.', 'om1', 'm1m', '1ca', 'a2n', '.ta4', 'o2n', 'an1d', 'ca1t', 'x1c', 'ter1', 'p2h', '1tio', 'n2at', 'hena4', '1ble', 'ex1', 'n1g', 's1s', 'io3n.', '1q', '2io', 'e2x', 'r1r', '1p', 't1t', 'gr2', 'ment1', 'hy3ph', 'l1l', '4ing.', '1m', 'pu2', '2mp', 'a1b', 'con1', 'b2l', '.re1', 'li1', '3ty.'], ['gram-mar', 'mis-sis-sip-pi', 'ta-ble'], 2, 1], 'hy-phenatio-n'), ('partial-repair probe', ['understand', ['1na', 'ment1', 'x1c', 'l1l', 'b2l', '.un1', 'gr2', 'an1d', '1p', '2mp', '2io', '1q', 'hen5at', 'hy3ph', 'a1b', 'n2at', 'om1', '5nd.', '3ty.', 'ex1', 'he2n', 'n1g', 'at1', 'ter1'], [], 1, 3], 'un-derstand'), ('partial-repair probe', ['running', ['p2h', '1m', '5nd.', 'c2ce', '1q', 'hen5at', '1ca', 'ment1', 's1s', 'io3n.', 'ex1', 'x1c', 'he2n', 'hy3ph', 'e2x', '2mp', '1tio', 'a2n', 'l1l', '1na', 'm1m', '3ty.', 'at1', 'ter1', 't1t', 'gr2', 'om1', '.ta4', 'ca1t', 'n2at', 'e1c', 'b2l', 'r1r', 'o2n', '1ble', '2io', '4ing.', 'con1', 'pu2', 'n1g', '.un1', 'hena4', 'a1b', '.re1', 'an1d'], ['gram-mar', 'mis-sis-sip-pi', 'pro-ject'], 2, 2], 'running'), ('word-final pattern ing.', ['running', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 2, 2], 'running'), ('capitalised exception', ['Table', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], ['ta-ble'], 1, 1], 'Ta-ble'), ('control layout', ['Paragraph', ['1ble', 'e2x', 'hena4', '1p', '3ty.', 'hy3ph', 's1s', 'n1g', '.ta4', 'io3n.', '2io', '.un1', 'at1'], [], 3, 1], 'Paragra-ph'), ('control layout', ['Table', ['ment1', 'o2n', '1ca', 'n2at', '5nd.', 'x1c', '2io', 'hena4', 'con1', 'l1l', 'ter1', 'r1r', 't1t', 'hen5at', '.un1', 'io3n.', '1m', '1tio', 'm1m', 'e1c', 'ca1t', 'p2h', '.re1', 'a2n', 'pu2', 'an1d'], [], 1, 3], 'Table')]]\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":"cfad5106d361aabe8eae31c1714584bb92a8d9892349d986ff3ee5e029abee4e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    word, patterns, exceptions, lmin, rmin = x\n    low = word.lower()\n    for e in exceptions:\n        if e.replace('-', '') == low:\n            out, count = '', 0\n            for c in e:\n                if c == '-':\n                    out += '-'\n                else:\n                    out += word[count]\n                    count += 1\n            return out\n    table = {}\n    for p in patterns:\n        letters = ''\n        vals = [0]\n        for c in p:\n            if c.isdigit():\n                vals[-1] = int(c)\n            else:\n                letters += c\n                vals.append(0)\n        table[letters] = vals\n    dotted = '.' + low + '.'\n    score = [0] * (len(dotted) + 1)\n    for s in range(len(dotted)):\n        for e in range(s + 1, len(dotted) + 1):\n            vals = table.get(dotted[s:e])\n            if vals:\n                for k, v in enumerate(vals):\n                    score[s + k] = max(score[s + k], v)\n    points = [i for i in range(1, len(word)) if score[i + 1] % 2 == 1 and i >= lmin and len(word) - i > rmin]\n    out = ''\n    for i, c in enumerate(word):\n        if i in points:\n            out += '-'\n        out += c\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: right hyphen minimum', ['running', ['t1t', 'li1', 'b2l', 'm1m', '.un1', 'e2x', 'x1c', 'a2n', 'l1l', 'pu2', 's1s', 'n1g', 'o2n', 'hy3ph', '.re1', '2mp', 'gr2', '2io', '.ta4', '1m', 'at1', '1p', 'e1c', 'c2ce', '1tio', '5nd.', 'hena4', 'he2n', '1ble', 'ment1', '3ty.', 'p2h', 'ca1t', 'ter1', 'hen5at', 'om1', 'a1b', 'ex1', 'an1d', 'con1', '4ing.', 'r1r', '1na', '1q', '1ca', 'n2at', 'io3n.'], ['ex-cep-tion', 'ta-ble'], 2, 1], 'runnin-g'), ('regression: right hyphen minimum', ['Mississippi', ['1q', '1tio', 'n1g', 'e2x', 'ca1t', '1p', 'hen5at', 'hena4', 'gr2', 'n2at', 'an1d', 'x1c', 'ment1', 'r1r', 'io3n.', '.un1', '.re1', 'c2ce', '1ble', 'hy3ph', '3ty.', '5nd.', 'e1c', 't1t', 'pu2', '.ta4', 'm1m', 'b2l', 'o2n', 'a1b', 'li1', 'he2n', 's1s', '4ing.'], ['ex-cep-tion'], 1, 3], 'Mis-sis-si-ppi'), ('partial-repair probe', ['understand', ['io3n.', 'n1g', 'x1c', 'e1c', 'l1l', 'con1', 's1s', 'm1m', 'li1', '.re1', '2mp', 'ter1', '1ca', 'hena4', '5nd.', 'an1d', '3ty.', 'b2l', 't1t', 'ex1', 'c2ce', 'om1', '1tio', '4ing.', 'e2x', 'hy3ph', '1p', 'a1b', 'pu2', 'he2n', 'ment1', '1ble', 'gr2', 'hen5at', '.ta4', 'r1r', '.un1', '1m', 'n2at', 'ca1t', 'p2h', '1na', '2io', '1q'], ['ta-ble', 'gram-mar', 'ex-cep-tion'], 2, 3], 'un-derstand'), ('partial-repair probe', ['understand', ['ca1t', 'l1l', 'an1d', 'n2at', 'a2n', 'gr2', 'c2ce', '3ty.', '1m', 'r1r', '1na', '2mp', 'he2n', '4ing.', 'ter1', 'a1b', 'om1', 'e1c', 'hen5at', 'n1g', '1ca', 'm1m', '2io', 'b2l', '.un1', 'pu2', 'hena4', 'o2n', '1p'], ['mis-sis-sip-pi', 'ta-ble'], 3, 2], 'understand'), ('capitalised exception', ['Table', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], ['ta-ble'], 1, 1], 'Ta-ble'), ('right minimum boundary', ['category', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 1, 3], 'ca-t-egory'), ('control layout', ['connection', ['.un1', 'ment1', 'ter1', '.re1', '1m', '1q', 'a1b', 'hena4', 'e1c', 'm1m', '1ble', 'p2h', 'c2ce', 'o2n', 'n1g', 'pu2', 'e2x', '1tio', 'x1c', 'r1r', 's1s', 'om1', 'con1', 'ex1'], ['pro-ject', 'ta-ble'], 3, 1], 'con-ne-c-tion'), ('control layout', ['Exception', ['ex1', '2io', 'io3n.', 'x1c', 'pu2', 'at1', '1m', 'hy3ph', 'om1', 'n2at', '1na', '2mp', '1p', 'n1g', '1tio', '.un1', 'e1c', '.re1', 'c2ce', 'o2n', 'b2l', '1ca', 'l1l'], ['gram-mar', 'pro-ject', 'ex-cep-tion'], 3, 1], 'Ex-cep-tion')], [('regression: right hyphen minimum', ['running', ['e1c', 'at1', '5nd.', '1na', 'hena4', 'pu2', 'li1', 'r1r', '2mp', '.ta4', '2io', 'ment1', 'an1d', 't1t', 'p2h', '.re1', '1m', 'ter1', 'hy3ph', 'ex1', 'n2at', '1tio', 'om1', 'b2l', 'c2ce', '4ing.', 'io3n.', 'con1', 'a2n', 'gr2', '.un1', 'a1b', 'x1c', '1ca', 'o2n', 'm1m', 'n1g'], ['pro-ject', 'gram-mar', 'ta-ble'], 1, 1], 'runnin-g'), ('regression: right hyphen minimum', ['literally', ['n2at', 'c2ce', '1q', '5nd.', 'p2h', '1p', '2io', 'l1l', '1ble', 'con1', 'n1g', '.ta4', 'r1r', 'he2n', '4ing.', 'hen5at', '2mp', 's1s', 'om1', '3ty.', 'hy3ph', '.un1', 'x1c', 'io3n.', 'a1b', 'an1d', 't1t', '1tio', 'li1', 'm1m', '1ca', 'ex1', '1na', '.re1', 'at1', 'pu2', 'e1c', 'gr2', '1m'], [], 1, 2], 'li-teral-ly'), ('partial-repair probe', ['understand', ['ca1t', 'l1l', 'an1d', 'n2at', 'a2n', 'gr2', 'c2ce', '3ty.', '1m', 'r1r', '1na', '2mp', 'he2n', '4ing.', 'ter1', 'a1b', 'om1', 'e1c', 'hen5at', 'n1g', '1ca', 'm1m', '2io', 'b2l', '.un1', 'pu2', 'hena4', 'o2n', '1p'], ['mis-sis-sip-pi', 'ta-ble'], 3, 2], 'understand'), ('partial-repair probe', ['Paragraph', ['x1c', '1na', 'n1g', 'b2l', 'hen5at', '.un1', '.ta4', 'con1', '1q', 'a2n', 'hena4', 'gr2', 'a1b', 'm1m', 'r1r', '1ca', 'n2at', 'c2ce', 'e1c', '4ing.', '2io', 's1s', 'io3n.', 'ex1', 'hy3ph', 'an1d', 'o2n', '1p', 'he2n', 'om1', 't1t', '1m', '.re1', 'at1', 'li1', '1tio'], ['ta-ble', 'gram-mar'], 1, 3], 'Paragraph'), ('word-final pattern ing.', ['running', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 2, 2], 'running'), ('left minimum boundary', ['excellent', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 2, 3], 'ex-cel-lent'), ('control layout', ['project', ['hy3ph', 'x1c', '.un1', '.ta4', 'con1', 'ment1', 'pu2', 'l1l', 'ca1t', 'a2n', '3ty.', 'hen5at', 'e2x', 's1s', 'gr2', 'a1b', 'e1c', 'o2n', 'hena4', '1ca', 'c2ce', '1q', 'n1g', 't1t', 'io3n.', 'li1', '1p', '2mp', 'ex1', '4ing.', 'b2l', 'om1', '1ble', 'p2h', 'n2at', 'm1m', '.re1', '1na', '5nd.', 'an1d', '2io', 'ter1', '1m', 'he2n', '1tio'], ['pro-ject', 'ta-ble'], 1, 2], 'pro-ject'), ('control layout', ['computer', ['ment1', 'gr2', 'pu2', 'hy3ph', 'r1r', '2mp', 'o2n', 'c2ce', 'a2n', '2io', '.re1', 's1s', 'hen5at', '.un1', 'm1m', 'hena4', '4ing.', 'x1c', 'ex1', 'ca1t', 'a1b', 'io3n.', 'l1l', '5nd.', '1m', '3ty.', 'n2at', 'ter1', '1ble', '1q', '1p', 'b2l', 'li1', 'e1c', '1ca', 'he2n'], ['ta-ble'], 2, 3], 'com-puter')], [('regression: right hyphen minimum', ['grammar', ['1p', 'io3n.', 'r1r', '4ing.', 'li1', 'ca1t', 'e1c', '1m', 'ment1', '.ta4', 'hen5at', 'm1m', 'ex1', '.un1', 'at1', 'gr2', '1na', 'an1d', '3ty.', '.re1', 'l1l', '2mp', 'a2n', 'b2l', '2io', 'c2ce', 'n1g', 'he2n', 'o2n', '1ca', '1tio', '1q'], ['ta-ble', 'pro-ject'], 2, 3], 'gra-m-mar'), ('regression: right hyphen minimum', ['understand', ['b2l', '1ca', '1m', '1tio', '2mp', 'ment1', 't1t', '1p', '.ta4', 'li1', 'e1c', '1q', '4ing.', 'ex1', '5nd.', 'om1', 'o2n', 'hen5at', 'l1l', 'ter1', 'hena4', '.un1', 'r1r', 'pu2', 'p2h'], ['mis-sis-sip-pi'], 3, 2], 'understa-nd'), ('partial-repair probe', ['hyphenation', ['ter1', 'b2l', 'o2n', '5nd.', 'e1c', '.ta4', 'n1g', 'om1', 'hena4', 'pu2', 'l1l', 'a2n', 'r1r', 'hy3ph', 't1t', '.re1', '1p', 'e2x', '1q', 'ca1t', '3ty.', '2mp', '1m', 'ment1', '4ing.', 'x1c', '1ble', 'p2h', 'li1', 'c2ce', 'n2at', '2io', 'an1d', 'con1', 'io3n.', 'm1m', 'gr2', 'ex1', '1na'], ['gram-mar'], 2, 2], 'hy-phe-nation'), ('partial-repair probe', ['Paragraph', ['1na', '1ca', '2io', '3ty.', 'p2h', '1p', '.un1', 'a1b', 'an1d', 'li1', 'io3n.', '1m', 'a2n', 'n1g'], [], 1, 3], 'Paragraph'), ('lowercase exception', ['project', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], ['pro-ject'], 2, 3], 'pro-ject'), ('capitalised exception', ['Table', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], ['ta-ble'], 1, 1], 'Ta-ble'), ('control layout', ['Paragraph', ['1m', '2mp', '.ta4', 'hy3ph', 'pu2', 'e2x', 'om1', '1tio', 'at1', '.un1', 'n2at', '1na', 'hena4', 'r1r', 'ca1t', '1q', '2io', '.re1', 'a2n', 'n1g', 'o2n', 'ter1', 'l1l', 'x1c', 'p2h', 'con1', '5nd.', 'he2n', '4ing.', 'b2l', 'm1m', '1ble', '1p', 'c2ce', 's1s'], ['gram-mar', 'pro-ject'], 3, 1], 'Paragra-ph'), ('control layout', ['Recreation', ['li1', 'an1d', 'at1', '1ble', 'io3n.', 'a2n', 'e2x', '1tio', '.un1', '3ty.', 'r1r', '2io', 'e1c', 'he2n', '1m', 'om1', 'hen5at', '.ta4', 'n1g', 'a1b', 'ment1', 'p2h', '4ing.', '.re1', '1na', 'b2l', 'c2ce', 't1t'], ['mis-sis-sip-pi', 'ex-cep-tion'], 2, 3], 'Re-crea-tion')], [('regression: right hyphen minimum', ['understand', ['hy3ph', 'ex1', 'p2h', 'e2x', 'm1m', 'hena4', 'an1d', '4ing.', 't1t', 'hen5at', 'a1b', 's1s', 'l1l', '.un1', 'n2at'], ['mis-sis-sip-pi', 'ex-cep-tion', 'pro-ject'], 2, 1], 'un-derstan-d'), ('regression: right hyphen minimum', ['Mississippi', ['5nd.', 'n2at', 'hena4', 'r1r', 'om1', 'e2x', 'hy3ph', 'an1d', '1p', 't1t', 'o2n', '.ta4', 'n1g', 'x1c', 'ter1', 's1s', 'li1', 'gr2', '2mp', '3ty.', 'p2h', 'c2ce', 'ex1', 'l1l', 'm1m', 'at1', 'a2n', '1ble', '4ing.', 'io3n.', '1tio', 'pu2', 'ca1t', '1m', 'a1b', 'con1', '.un1'], [], 1, 2], 'Mis-sis-si-p-pi'), ('partial-repair probe', ['Paragraph', ['s1s', 'io3n.', 'ca1t', 'x1c', 'hen5at', '.un1', '2mp', '4ing.', 'l1l', '1m', '1tio', 'gr2', 'b2l', '3ty.', 't1t', 'a1b', 'e1c', 'c2ce', 'pu2', 'ter1', 'o2n', '1q', 'r1r', '1p', 'm1m', 'n2at'], ['pro-ject'], 3, 3], 'Paragraph'), ('partial-repair probe', ['typesetting', ['he2n', '5nd.', 'x1c', '2mp', 'e1c', 'ment1', 'p2h', 'ca1t', 'a2n', 'hena4', '1tio', '.re1', 'gr2', 'hen5at', 'hy3ph', 'ex1', 'an1d', 'pu2', 'm1m', 't1t', '1ble', '1ca', 'b2l', 'n1g', '2io', 'r1r', '.un1', 'o2n', '4ing.', '.ta4', '1p', '3ty.', 'io3n.', 'e2x', 's1s', '1m', 'l1l', '1na', 'ter1'], [], 3, 2], 'typeset-ting'), ('left minimum boundary', ['excellent', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 2, 3], 'ex-cel-lent'), ('right minimum boundary', ['category', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 1, 3], 'ca-t-egory'), ('control layout', ['Unexpected', ['1m', '1tio', 'ment1', 'm1m', 'c2ce', 'r1r', '1ca', '4ing.'], [], 1, 3], 'Unexpected'), ('control layout', ['battle', ['m1m', '3ty.', 'at1', '.un1', '2io', 'c2ce', '.ta4', 'gr2', 'an1d', '5nd.', 'a2n', 'he2n', 'p2h', 'li1', 'io3n.', '2mp', '4ing.', 't1t', '.re1', 'x1c', '1q', 'hena4', 'con1', 'n1g', 'a1b', 'n2at', 'e2x', 'om1', 'l1l', 'ter1', 'o2n', '1m', '1ble', 'ment1', '1p', 's1s', 'b2l', '1tio', '1ca', 'e1c', 'hy3ph', 'r1r', 'ex1', 'ca1t'], ['mis-sis-sip-pi', 'pro-ject'], 3, 2], 'bat-tle')], [('regression: right hyphen minimum', ['hyphenation', ['a2n', 'at1', 'e1c', '1tio', 'p2h', 'n2at', 'gr2', 'pu2', '.re1', 'an1d', 'ca1t', 'e2x', 't1t', 'l1l', '1ca', 'n1g', '1p', 'li1', '3ty.', 'hy3ph', '5nd.', '.un1', 'c2ce', '.ta4', 'om1', '1na'], ['pro-ject', 'gram-mar'], 1, 3], 'hy-phe-na-t-ion'), ('regression: right hyphen minimum', ['hyphenation', ['5nd.', 'om1', 'm1m', '1ca', 'a2n', '.ta4', 'o2n', 'an1d', 'ca1t', 'x1c', 'ter1', 'p2h', '1tio', 'n2at', 'hena4', '1ble', 'ex1', 'n1g', 's1s', 'io3n.', '1q', '2io', 'e2x', 'r1r', '1p', 't1t', 'gr2', 'ment1', 'hy3ph', 'l1l', '4ing.', '1m', 'pu2', '2mp', 'a1b', 'con1', 'b2l', '.re1', 'li1', '3ty.'], ['gram-mar', 'mis-sis-sip-pi', 'ta-ble'], 2, 1], 'hy-phenatio-n'), ('partial-repair probe', ['understand', ['1na', 'ment1', 'x1c', 'l1l', 'b2l', '.un1', 'gr2', 'an1d', '1p', '2mp', '2io', '1q', 'hen5at', 'hy3ph', 'a1b', 'n2at', 'om1', '5nd.', '3ty.', 'ex1', 'he2n', 'n1g', 'at1', 'ter1'], [], 1, 3], 'un-derstand'), ('partial-repair probe', ['running', ['p2h', '1m', '5nd.', 'c2ce', '1q', 'hen5at', '1ca', 'ment1', 's1s', 'io3n.', 'ex1', 'x1c', 'he2n', 'hy3ph', 'e2x', '2mp', '1tio', 'a2n', 'l1l', '1na', 'm1m', '3ty.', 'at1', 'ter1', 't1t', 'gr2', 'om1', '.ta4', 'ca1t', 'n2at', 'e1c', 'b2l', 'r1r', 'o2n', '1ble', '2io', '4ing.', 'con1', 'pu2', 'n1g', '.un1', 'hena4', 'a1b', '.re1', 'an1d'], ['gram-mar', 'mis-sis-sip-pi', 'pro-ject'], 2, 2], 'running'), ('word-final pattern ing.', ['running', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 2, 2], 'running'), ('capitalised exception', ['Table', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], ['ta-ble'], 1, 1], 'Ta-ble'), ('control layout', ['Paragraph', ['1ble', 'e2x', 'hena4', '1p', '3ty.', 'hy3ph', 's1s', 'n1g', '.ta4', 'io3n.', '2io', '.un1', 'at1'], [], 3, 1], 'Paragra-ph'), ('control layout', ['Table', ['ment1', 'o2n', '1ca', 'n2at', '5nd.', 'x1c', '2io', 'hena4', 'con1', 'l1l', 'ter1', 'r1r', 't1t', 'hen5at', '.un1', 'io3n.', '1m', '1tio', 'm1m', 'e1c', 'ca1t', 'p2h', '.re1', 'a2n', 'pu2', 'an1d'], [], 1, 3], 'Table')]]\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":"e5d5305ac95d3d198ce261a9c3ac875c3c0b1d8fb3ea984a127b1de498f8730b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    word, patterns, exceptions, lmin, rmin = x\n    low = word.lower()\n    for e in exceptions:\n        if e.replace('-', '') == low:\n            out, count = '', 0\n            for c in e:\n                if c == '-':\n                    out += '-'\n                else:\n                    out += word[count]\n                    count += 1\n            return out\n    table = {}\n    for p in patterns:\n        letters = ''\n        vals = [0]\n        for c in p:\n            if c.isdigit():\n                vals[-1] = int(c)\n            else:\n                letters += c\n                vals.append(0)\n        table[letters] = vals\n    dotted = '.' + low + '.'\n    score = [0] * (len(dotted) + 1)\n    for s in range(len(dotted)):\n        for e in range(s + 1, len(dotted) + 1):\n            vals = table.get(dotted[s:e])\n            if vals:\n                for k, v in enumerate(vals):\n                    score[s + k] = max(score[s + k], v)\n    points = [i for i in range(1, len(word)) if score[i + 1] % 2 == 1 and i >= lmin and len(word) - i >= rmin]\n    out = ''\n    for i, c in enumerate(word):\n        if i in points:\n            out += '-'\n        out += c\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: right hyphen minimum', ['running', ['t1t', 'li1', 'b2l', 'm1m', '.un1', 'e2x', 'x1c', 'a2n', 'l1l', 'pu2', 's1s', 'n1g', 'o2n', 'hy3ph', '.re1', '2mp', 'gr2', '2io', '.ta4', '1m', 'at1', '1p', 'e1c', 'c2ce', '1tio', '5nd.', 'hena4', 'he2n', '1ble', 'ment1', '3ty.', 'p2h', 'ca1t', 'ter1', 'hen5at', 'om1', 'a1b', 'ex1', 'an1d', 'con1', '4ing.', 'r1r', '1na', '1q', '1ca', 'n2at', 'io3n.'], ['ex-cep-tion', 'ta-ble'], 2, 1], 'runnin-g'), ('regression: right hyphen minimum', ['Mississippi', ['1q', '1tio', 'n1g', 'e2x', 'ca1t', '1p', 'hen5at', 'hena4', 'gr2', 'n2at', 'an1d', 'x1c', 'ment1', 'r1r', 'io3n.', '.un1', '.re1', 'c2ce', '1ble', 'hy3ph', '3ty.', '5nd.', 'e1c', 't1t', 'pu2', '.ta4', 'm1m', 'b2l', 'o2n', 'a1b', 'li1', 'he2n', 's1s', '4ing.'], ['ex-cep-tion'], 1, 3], 'Mis-sis-si-ppi'), ('partial-repair probe', ['understand', ['io3n.', 'n1g', 'x1c', 'e1c', 'l1l', 'con1', 's1s', 'm1m', 'li1', '.re1', '2mp', 'ter1', '1ca', 'hena4', '5nd.', 'an1d', '3ty.', 'b2l', 't1t', 'ex1', 'c2ce', 'om1', '1tio', '4ing.', 'e2x', 'hy3ph', '1p', 'a1b', 'pu2', 'he2n', 'ment1', '1ble', 'gr2', 'hen5at', '.ta4', 'r1r', '.un1', '1m', 'n2at', 'ca1t', 'p2h', '1na', '2io', '1q'], ['ta-ble', 'gram-mar', 'ex-cep-tion'], 2, 3], 'un-derstand'), ('partial-repair probe', ['understand', ['ca1t', 'l1l', 'an1d', 'n2at', 'a2n', 'gr2', 'c2ce', '3ty.', '1m', 'r1r', '1na', '2mp', 'he2n', '4ing.', 'ter1', 'a1b', 'om1', 'e1c', 'hen5at', 'n1g', '1ca', 'm1m', '2io', 'b2l', '.un1', 'pu2', 'hena4', 'o2n', '1p'], ['mis-sis-sip-pi', 'ta-ble'], 3, 2], 'understand'), ('capitalised exception', ['Table', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], ['ta-ble'], 1, 1], 'Ta-ble'), ('right minimum boundary', ['category', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 1, 3], 'ca-t-egory'), ('control layout', ['connection', ['.un1', 'ment1', 'ter1', '.re1', '1m', '1q', 'a1b', 'hena4', 'e1c', 'm1m', '1ble', 'p2h', 'c2ce', 'o2n', 'n1g', 'pu2', 'e2x', '1tio', 'x1c', 'r1r', 's1s', 'om1', 'con1', 'ex1'], ['pro-ject', 'ta-ble'], 3, 1], 'con-ne-c-tion'), ('control layout', ['Exception', ['ex1', '2io', 'io3n.', 'x1c', 'pu2', 'at1', '1m', 'hy3ph', 'om1', 'n2at', '1na', '2mp', '1p', 'n1g', '1tio', '.un1', 'e1c', '.re1', 'c2ce', 'o2n', 'b2l', '1ca', 'l1l'], ['gram-mar', 'pro-ject', 'ex-cep-tion'], 3, 1], 'Ex-cep-tion')], [('regression: right hyphen minimum', ['running', ['e1c', 'at1', '5nd.', '1na', 'hena4', 'pu2', 'li1', 'r1r', '2mp', '.ta4', '2io', 'ment1', 'an1d', 't1t', 'p2h', '.re1', '1m', 'ter1', 'hy3ph', 'ex1', 'n2at', '1tio', 'om1', 'b2l', 'c2ce', '4ing.', 'io3n.', 'con1', 'a2n', 'gr2', '.un1', 'a1b', 'x1c', '1ca', 'o2n', 'm1m', 'n1g'], ['pro-ject', 'gram-mar', 'ta-ble'], 1, 1], 'runnin-g'), ('regression: right hyphen minimum', ['literally', ['n2at', 'c2ce', '1q', '5nd.', 'p2h', '1p', '2io', 'l1l', '1ble', 'con1', 'n1g', '.ta4', 'r1r', 'he2n', '4ing.', 'hen5at', '2mp', 's1s', 'om1', '3ty.', 'hy3ph', '.un1', 'x1c', 'io3n.', 'a1b', 'an1d', 't1t', '1tio', 'li1', 'm1m', '1ca', 'ex1', '1na', '.re1', 'at1', 'pu2', 'e1c', 'gr2', '1m'], [], 1, 2], 'li-teral-ly'), ('partial-repair probe', ['understand', ['ca1t', 'l1l', 'an1d', 'n2at', 'a2n', 'gr2', 'c2ce', '3ty.', '1m', 'r1r', '1na', '2mp', 'he2n', '4ing.', 'ter1', 'a1b', 'om1', 'e1c', 'hen5at', 'n1g', '1ca', 'm1m', '2io', 'b2l', '.un1', 'pu2', 'hena4', 'o2n', '1p'], ['mis-sis-sip-pi', 'ta-ble'], 3, 2], 'understand'), ('partial-repair probe', ['Paragraph', ['x1c', '1na', 'n1g', 'b2l', 'hen5at', '.un1', '.ta4', 'con1', '1q', 'a2n', 'hena4', 'gr2', 'a1b', 'm1m', 'r1r', '1ca', 'n2at', 'c2ce', 'e1c', '4ing.', '2io', 's1s', 'io3n.', 'ex1', 'hy3ph', 'an1d', 'o2n', '1p', 'he2n', 'om1', 't1t', '1m', '.re1', 'at1', 'li1', '1tio'], ['ta-ble', 'gram-mar'], 1, 3], 'Paragraph'), ('word-final pattern ing.', ['running', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 2, 2], 'running'), ('left minimum boundary', ['excellent', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 2, 3], 'ex-cel-lent'), ('control layout', ['project', ['hy3ph', 'x1c', '.un1', '.ta4', 'con1', 'ment1', 'pu2', 'l1l', 'ca1t', 'a2n', '3ty.', 'hen5at', 'e2x', 's1s', 'gr2', 'a1b', 'e1c', 'o2n', 'hena4', '1ca', 'c2ce', '1q', 'n1g', 't1t', 'io3n.', 'li1', '1p', '2mp', 'ex1', '4ing.', 'b2l', 'om1', '1ble', 'p2h', 'n2at', 'm1m', '.re1', '1na', '5nd.', 'an1d', '2io', 'ter1', '1m', 'he2n', '1tio'], ['pro-ject', 'ta-ble'], 1, 2], 'pro-ject'), ('control layout', ['computer', ['ment1', 'gr2', 'pu2', 'hy3ph', 'r1r', '2mp', 'o2n', 'c2ce', 'a2n', '2io', '.re1', 's1s', 'hen5at', '.un1', 'm1m', 'hena4', '4ing.', 'x1c', 'ex1', 'ca1t', 'a1b', 'io3n.', 'l1l', '5nd.', '1m', '3ty.', 'n2at', 'ter1', '1ble', '1q', '1p', 'b2l', 'li1', 'e1c', '1ca', 'he2n'], ['ta-ble'], 2, 3], 'com-puter')], [('regression: right hyphen minimum', ['grammar', ['1p', 'io3n.', 'r1r', '4ing.', 'li1', 'ca1t', 'e1c', '1m', 'ment1', '.ta4', 'hen5at', 'm1m', 'ex1', '.un1', 'at1', 'gr2', '1na', 'an1d', '3ty.', '.re1', 'l1l', '2mp', 'a2n', 'b2l', '2io', 'c2ce', 'n1g', 'he2n', 'o2n', '1ca', '1tio', '1q'], ['ta-ble', 'pro-ject'], 2, 3], 'gra-m-mar'), ('regression: right hyphen minimum', ['understand', ['b2l', '1ca', '1m', '1tio', '2mp', 'ment1', 't1t', '1p', '.ta4', 'li1', 'e1c', '1q', '4ing.', 'ex1', '5nd.', 'om1', 'o2n', 'hen5at', 'l1l', 'ter1', 'hena4', '.un1', 'r1r', 'pu2', 'p2h'], ['mis-sis-sip-pi'], 3, 2], 'understa-nd'), ('partial-repair probe', ['hyphenation', ['ter1', 'b2l', 'o2n', '5nd.', 'e1c', '.ta4', 'n1g', 'om1', 'hena4', 'pu2', 'l1l', 'a2n', 'r1r', 'hy3ph', 't1t', '.re1', '1p', 'e2x', '1q', 'ca1t', '3ty.', '2mp', '1m', 'ment1', '4ing.', 'x1c', '1ble', 'p2h', 'li1', 'c2ce', 'n2at', '2io', 'an1d', 'con1', 'io3n.', 'm1m', 'gr2', 'ex1', '1na'], ['gram-mar'], 2, 2], 'hy-phe-nation'), ('partial-repair probe', ['Paragraph', ['1na', '1ca', '2io', '3ty.', 'p2h', '1p', '.un1', 'a1b', 'an1d', 'li1', 'io3n.', '1m', 'a2n', 'n1g'], [], 1, 3], 'Paragraph'), ('lowercase exception', ['project', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], ['pro-ject'], 2, 3], 'pro-ject'), ('capitalised exception', ['Table', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], ['ta-ble'], 1, 1], 'Ta-ble'), ('control layout', ['Paragraph', ['1m', '2mp', '.ta4', 'hy3ph', 'pu2', 'e2x', 'om1', '1tio', 'at1', '.un1', 'n2at', '1na', 'hena4', 'r1r', 'ca1t', '1q', '2io', '.re1', 'a2n', 'n1g', 'o2n', 'ter1', 'l1l', 'x1c', 'p2h', 'con1', '5nd.', 'he2n', '4ing.', 'b2l', 'm1m', '1ble', '1p', 'c2ce', 's1s'], ['gram-mar', 'pro-ject'], 3, 1], 'Paragra-ph'), ('control layout', ['Recreation', ['li1', 'an1d', 'at1', '1ble', 'io3n.', 'a2n', 'e2x', '1tio', '.un1', '3ty.', 'r1r', '2io', 'e1c', 'he2n', '1m', 'om1', 'hen5at', '.ta4', 'n1g', 'a1b', 'ment1', 'p2h', '4ing.', '.re1', '1na', 'b2l', 'c2ce', 't1t'], ['mis-sis-sip-pi', 'ex-cep-tion'], 2, 3], 'Re-crea-tion')], [('regression: right hyphen minimum', ['understand', ['hy3ph', 'ex1', 'p2h', 'e2x', 'm1m', 'hena4', 'an1d', '4ing.', 't1t', 'hen5at', 'a1b', 's1s', 'l1l', '.un1', 'n2at'], ['mis-sis-sip-pi', 'ex-cep-tion', 'pro-ject'], 2, 1], 'un-derstan-d'), ('regression: right hyphen minimum', ['Mississippi', ['5nd.', 'n2at', 'hena4', 'r1r', 'om1', 'e2x', 'hy3ph', 'an1d', '1p', 't1t', 'o2n', '.ta4', 'n1g', 'x1c', 'ter1', 's1s', 'li1', 'gr2', '2mp', '3ty.', 'p2h', 'c2ce', 'ex1', 'l1l', 'm1m', 'at1', 'a2n', '1ble', '4ing.', 'io3n.', '1tio', 'pu2', 'ca1t', '1m', 'a1b', 'con1', '.un1'], [], 1, 2], 'Mis-sis-si-p-pi'), ('partial-repair probe', ['Paragraph', ['s1s', 'io3n.', 'ca1t', 'x1c', 'hen5at', '.un1', '2mp', '4ing.', 'l1l', '1m', '1tio', 'gr2', 'b2l', '3ty.', 't1t', 'a1b', 'e1c', 'c2ce', 'pu2', 'ter1', 'o2n', '1q', 'r1r', '1p', 'm1m', 'n2at'], ['pro-ject'], 3, 3], 'Paragraph'), ('partial-repair probe', ['typesetting', ['he2n', '5nd.', 'x1c', '2mp', 'e1c', 'ment1', 'p2h', 'ca1t', 'a2n', 'hena4', '1tio', '.re1', 'gr2', 'hen5at', 'hy3ph', 'ex1', 'an1d', 'pu2', 'm1m', 't1t', '1ble', '1ca', 'b2l', 'n1g', '2io', 'r1r', '.un1', 'o2n', '4ing.', '.ta4', '1p', '3ty.', 'io3n.', 'e2x', 's1s', '1m', 'l1l', '1na', 'ter1'], [], 3, 2], 'typeset-ting'), ('left minimum boundary', ['excellent', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 2, 3], 'ex-cel-lent'), ('right minimum boundary', ['category', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 1, 3], 'ca-t-egory'), ('control layout', ['Unexpected', ['1m', '1tio', 'ment1', 'm1m', 'c2ce', 'r1r', '1ca', '4ing.'], [], 1, 3], 'Unexpected'), ('control layout', ['battle', ['m1m', '3ty.', 'at1', '.un1', '2io', 'c2ce', '.ta4', 'gr2', 'an1d', '5nd.', 'a2n', 'he2n', 'p2h', 'li1', 'io3n.', '2mp', '4ing.', 't1t', '.re1', 'x1c', '1q', 'hena4', 'con1', 'n1g', 'a1b', 'n2at', 'e2x', 'om1', 'l1l', 'ter1', 'o2n', '1m', '1ble', 'ment1', '1p', 's1s', 'b2l', '1tio', '1ca', 'e1c', 'hy3ph', 'r1r', 'ex1', 'ca1t'], ['mis-sis-sip-pi', 'pro-ject'], 3, 2], 'bat-tle')], [('regression: right hyphen minimum', ['hyphenation', ['a2n', 'at1', 'e1c', '1tio', 'p2h', 'n2at', 'gr2', 'pu2', '.re1', 'an1d', 'ca1t', 'e2x', 't1t', 'l1l', '1ca', 'n1g', '1p', 'li1', '3ty.', 'hy3ph', '5nd.', '.un1', 'c2ce', '.ta4', 'om1', '1na'], ['pro-ject', 'gram-mar'], 1, 3], 'hy-phe-na-t-ion'), ('regression: right hyphen minimum', ['hyphenation', ['5nd.', 'om1', 'm1m', '1ca', 'a2n', '.ta4', 'o2n', 'an1d', 'ca1t', 'x1c', 'ter1', 'p2h', '1tio', 'n2at', 'hena4', '1ble', 'ex1', 'n1g', 's1s', 'io3n.', '1q', '2io', 'e2x', 'r1r', '1p', 't1t', 'gr2', 'ment1', 'hy3ph', 'l1l', '4ing.', '1m', 'pu2', '2mp', 'a1b', 'con1', 'b2l', '.re1', 'li1', '3ty.'], ['gram-mar', 'mis-sis-sip-pi', 'ta-ble'], 2, 1], 'hy-phenatio-n'), ('partial-repair probe', ['understand', ['1na', 'ment1', 'x1c', 'l1l', 'b2l', '.un1', 'gr2', 'an1d', '1p', '2mp', '2io', '1q', 'hen5at', 'hy3ph', 'a1b', 'n2at', 'om1', '5nd.', '3ty.', 'ex1', 'he2n', 'n1g', 'at1', 'ter1'], [], 1, 3], 'un-derstand'), ('partial-repair probe', ['running', ['p2h', '1m', '5nd.', 'c2ce', '1q', 'hen5at', '1ca', 'ment1', 's1s', 'io3n.', 'ex1', 'x1c', 'he2n', 'hy3ph', 'e2x', '2mp', '1tio', 'a2n', 'l1l', '1na', 'm1m', '3ty.', 'at1', 'ter1', 't1t', 'gr2', 'om1', '.ta4', 'ca1t', 'n2at', 'e1c', 'b2l', 'r1r', 'o2n', '1ble', '2io', '4ing.', 'con1', 'pu2', 'n1g', '.un1', 'hena4', 'a1b', '.re1', 'an1d'], ['gram-mar', 'mis-sis-sip-pi', 'pro-ject'], 2, 2], 'running'), ('word-final pattern ing.', ['running', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], [], 2, 2], 'running'), ('capitalised exception', ['Table', ['.ta4', 'a1b', 'b2l', '1ble', 'hy3ph', 'he2n', 'hena4', 'hen5at', '1na', 'n2at', '1tio', '2io', 'o2n', 'pu2', 'ter1', '1m', 'ex1', 'e1c', 'c2ce', 'con1', 'ment1', '4ing.', 'n1g', '.re1', 'gr2', '3ty.', 'li1', '1ca', 'ca1t', 'at1', 'io3n.', 'r1r', 'm1m', 'l1l', 't1t', 's1s', 'a2n', 'an1d', '5nd.', '1p', 'p2h', '1q', '.un1', 'e2x', 'x1c', '2mp', 'om1'], ['ta-ble'], 1, 1], 'Ta-ble'), ('control layout', ['Paragraph', ['1ble', 'e2x', 'hena4', '1p', '3ty.', 'hy3ph', 's1s', 'n1g', '.ta4', 'io3n.', '2io', '.un1', 'at1'], [], 3, 1], 'Paragra-ph'), ('control layout', ['Table', ['ment1', 'o2n', '1ca', 'n2at', '5nd.', 'x1c', '2io', 'hena4', 'con1', 'l1l', 'ter1', 'r1r', 't1t', 'hen5at', '.un1', 'io3n.', '1m', '1tio', 'm1m', 'e1c', 'ca1t', 'p2h', '.re1', 'a2n', 'pu2', 'an1d'], [], 1, 3], 'Table')]]\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-liang-patterns-right-hyphen-minimum","generated_at":"2026-09-29T14:49:48.985264+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":"Require at least righthyphenmin letters after the hyphen.","root_cause":"The right minimum requires strictly more than righthyphenmin trailing letters.","sha256":"e3053ab1cf0ab156625b399ee6a1e5ffb93506419f6a66aca945398ffc6ec319","title":"Pattern-based hyphenation: right hyphen minimum · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.841,"exit_code":1,"observations":[{"actual":"runnin-g","check":"regression: right hyphen minimum","expected":"runnin-g","passed":true},{"actual":"Mis-sis-si-p-pi","check":"regression: right hyphen minimum","expected":"Mis-sis-si-ppi","passed":false},{"actual":"un-dersta-nd","check":"partial-repair probe","expected":"un-derstand","passed":false},{"actual":"understan-d","check":"partial-repair probe","expected":"understand","passed":false},{"actual":"Ta-ble","check":"capitalised exception","expected":"Ta-ble","passed":true},{"actual":"ca-t-egory","check":"right minimum boundary","expected":"ca-t-egory","passed":true},{"actual":"con-ne-c-tion","check":"control layout","expected":"con-ne-c-tion","passed":true},{"actual":"Ex-cep-tion","check":"control layout","expected":"Ex-cep-tion","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: right hyphen minimum\", \"actual\": \"runnin-g\", \"expected\": \"runnin-g\", \"passed\": true}, {\"check\": \"regression: right hyphen minimum\", \"actual\": \"Mis-sis-si-p-pi\", \"expected\": \"Mis-sis-si-ppi\", \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": \"un-dersta-nd\", \"expected\": \"un-derstand\", \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": \"understan-d\", \"expected\": \"understand\", \"passed\": false}, {\"check\": \"capitalised exception\", \"actual\": \"Ta-ble\", \"expected\": \"Ta-ble\", \"passed\": true}, {\"check\": \"right minimum boundary\", \"actual\": \"ca-t-egory\", \"expected\": \"ca-t-egory\", \"passed\": true}, {\"check\": \"control layout\", \"actual\": \"con-ne-c-tion\", \"expected\": \"con-ne-c-tion\", \"passed\": true}, {\"check\": \"control layout\", \"actual\": \"Ex-cep-tion\", \"expected\": \"Ex-cep-tion\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.368,"exit_code":1,"observations":[{"actual":"running","check":"regression: right hyphen minimum","expected":"runnin-g","passed":false},{"actual":"Mis-sis-sippi","check":"regression: right hyphen minimum","expected":"Mis-sis-si-ppi","passed":false},{"actual":"un-derstand","check":"partial-repair probe","expected":"un-derstand","passed":true},{"actual":"understand","check":"partial-repair probe","expected":"understand","passed":true},{"actual":"Ta-ble","check":"capitalised exception","expected":"Ta-ble","passed":true},{"actual":"ca-t-egory","check":"right minimum boundary","expected":"ca-t-egory","passed":true},{"actual":"con-ne-c-tion","check":"control layout","expected":"con-ne-c-tion","passed":true},{"actual":"Ex-cep-tion","check":"control layout","expected":"Ex-cep-tion","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: right hyphen minimum\", \"actual\": \"running\", \"expected\": \"runnin-g\", \"passed\": false}, {\"check\": \"regression: right hyphen minimum\", \"actual\": \"Mis-sis-sippi\", \"expected\": \"Mis-sis-si-ppi\", \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": \"un-derstand\", \"expected\": \"un-derstand\", \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": \"understand\", \"expected\": \"understand\", \"passed\": true}, {\"check\": \"capitalised exception\", \"actual\": \"Ta-ble\", \"expected\": \"Ta-ble\", \"passed\": true}, {\"check\": \"right minimum boundary\", \"actual\": \"ca-t-egory\", \"expected\": \"ca-t-egory\", \"passed\": true}, {\"check\": \"control layout\", \"actual\": \"con-ne-c-tion\", \"expected\": \"con-ne-c-tion\", \"passed\": true}, {\"check\": \"control layout\", \"actual\": \"Ex-cep-tion\", \"expected\": \"Ex-cep-tion\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":45.511,"exit_code":0,"observations":[{"actual":"runnin-g","check":"regression: right hyphen minimum","expected":"runnin-g","passed":true},{"actual":"Mis-sis-si-ppi","check":"regression: right hyphen minimum","expected":"Mis-sis-si-ppi","passed":true},{"actual":"un-derstand","check":"partial-repair probe","expected":"un-derstand","passed":true},{"actual":"understand","check":"partial-repair probe","expected":"understand","passed":true},{"actual":"Ta-ble","check":"capitalised exception","expected":"Ta-ble","passed":true},{"actual":"ca-t-egory","check":"right minimum boundary","expected":"ca-t-egory","passed":true},{"actual":"con-ne-c-tion","check":"control layout","expected":"con-ne-c-tion","passed":true},{"actual":"Ex-cep-tion","check":"control layout","expected":"Ex-cep-tion","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: right hyphen minimum\", \"actual\": \"runnin-g\", \"expected\": \"runnin-g\", \"passed\": true}, {\"check\": \"regression: right hyphen minimum\", \"actual\": \"Mis-sis-si-ppi\", \"expected\": \"Mis-sis-si-ppi\", \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": \"un-derstand\", \"expected\": \"un-derstand\", \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": \"understand\", \"expected\": \"understand\", \"passed\": true}, {\"check\": \"capitalised exception\", \"actual\": \"Ta-ble\", \"expected\": \"Ta-ble\", \"passed\": true}, {\"check\": \"right minimum boundary\", \"actual\": \"ca-t-egory\", \"expected\": \"ca-t-egory\", \"passed\": true}, {\"check\": \"control layout\", \"actual\": \"con-ne-c-tion\", \"expected\": \"con-ne-c-tion\", \"passed\": true}, {\"check\": \"control layout\", \"actual\": \"Ex-cep-tion\", \"expected\": \"Ex-cep-tion\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}