{"abstract":"Inhibiting even digits are overwritten by later odd digits.","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":"Summing the digits turns two odd values into an even inhibition.","family":"w2-typography-line-breaking-liang-patterns-competing-digit-resolution","id":"FA-79916","implementations":{"attempt":{"sha256":"2bf273c280d09fcf44ccd20e9ebbf5f12d333f32d2bed5d9b673f9c268f85891","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] = 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 = [[('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'), ('regression: competing digit resolution', ['Commitment', ['pu2', '.re1', 'b2l', '2io', 'o2n', 'an1d', 'at1', 'a2n', '1m', 'l1l', 'ca1t', 'con1', 'e2x', 'ter1', 'n2at', 't1t', 'hen5at', '1p', '1q', '3ty.', 'ment1', 'ex1', '1na', 'hy3ph', 's1s'], ['ta-ble', 'pro-ject'], 3, 3], 'Com-mit-ment'), ('partial-repair probe', ['Recreation', ['.re1', '5nd.', 'li1', 'ment1', 'o2n', 'hen5at', 's1s', 'n1g', 'ca1t', 'io3n.', 'e2x', '1na', 'c2ce', '1tio', '1p', '2io', 'l1l', 'hena4', 'm1m', 'a2n', 'hy3ph', 'om1', '1m', 'a1b', '.ta4', 'an1d', '.un1', 't1t', 'x1c', 'pu2', 'he2n', 'b2l', 'at1', 'con1', '1q', 'r1r', 'ter1'], [], 2, 2], 'Re-crea-tion'), ('regression: competing digit resolution', ['hyphenation', ['1m', 'n2at', '3ty.', '1tio', '2io', 't1t', 'a2n', 'ca1t', '1p', 'x1c', '1na', '.un1', 'he2n', 'm1m', 'e1c', 'con1', 's1s', 'ex1', '4ing.', 'c2ce', 'hen5at', '1q', 'an1d', 'p2h', 'gr2', '2mp', 'hy3ph', 'l1l', 'r1r', 'n1g', 'ment1', 'ter1', '.re1', 'io3n.', 'at1', '.ta4', '1ble', 'b2l', 'o2n', 'e2x', 'li1', '1ca'], ['gram-mar'], 3, 2], 'hyphen-a-tion'), ('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'), ('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', ['Recreation', ['o2n', '.re1', 't1t', '4ing.', 'l1l', 'm1m', 'gr2', 'li1', 'ter1', '2io'], ['ta-ble', 'ex-cep-tion', 'mis-sis-sip-pi'], 2, 3], 'Re-creation'), ('control layout', ['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')], [('regression: competing digit resolution', ['Recreation', ['2io', 'li1', 'io3n.', 'a2n', 'ment1', 'n1g', 'e1c', 'ter1', '1q', 'x1c', 'he2n', 'p2h', '1tio', '4ing.', 'm1m', '.re1', 'o2n', 'gr2', 'l1l', '1na', 'om1', '.ta4', 'hena4', '.un1', '1ble', 'con1', '1m', 'ex1', 'hen5at', 'pu2', 'n2at', 'hy3ph', '1ca'], ['pro-ject'], 3, 1], 'Recrea-tio-n'), ('regression: competing digit resolution', ['Table', ['ca1t', '2io', '.re1', 'ex1', 'io3n.', '.un1', 'x1c', 'he2n', 'c2ce', 'a1b', '.ta4', 'gr2', 't1t', '1m', '1ble', 'an1d', 'om1', '4ing.', 'o2n', 'a2n', '5nd.', 'pu2', 'n1g', 's1s', 'con1', 'hena4', 'e2x', 'ter1', '2mp', 'hen5at', 'e1c', 'm1m', 'p2h', 'ment1', '1p', '1q', '1na', '3ty.', '1ca', 'at1', 'b2l', 'n2at'], ['gram-mar', 'ex-cep-tion', 'pro-ject'], 1, 1], 'Table'), ('regression: competing digit resolution', ['hyphenation', ['e2x', 'he2n', 'ex1', 'hy3ph', 'io3n.', '5nd.', 'con1', 'om1', '.un1', 'm1m', 'pu2', '1ca', 'n1g', 'ca1t', 'n2at', '2io', '1tio', '4ing.', 's1s', '2mp', 'e1c', 'at1', 't1t', 'x1c', 'hena4', 'ter1', 'ment1', 'gr2', '1m', '1p', 'b2l', 'c2ce', '.re1', '1ble', 'r1r', '.ta4', 'hen5at', 'a1b', 'p2h', '1q'], [], 1, 2], 'hy-phen-ation'), ('regression: competing digit resolution', ['computer', ['1tio', 'om1', 'a1b', 't1t', 'he2n', 'e1c', 'ment1', 'io3n.', '1ble', 'b2l', 'an1d', '2mp', 'pu2', 'o2n', '3ty.', 'l1l', '1na', 'hena4', 'hy3ph', '.ta4', 'con1', 'ex1', 'at1', 'r1r', 'ter1', '5nd.', 'li1', 'ca1t', '1p', '1ca', 'gr2', 'n2at', '.re1', '4ing.', '1m', '.un1', 'a2n', 'x1c', 'e2x', 'n1g', '1q', '2io', 's1s', 'c2ce'], [], 1, 1], 'com-puter'), ('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'), ('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'), ('control layout', ['category', ['o2n', '2mp', 'ment1', 't1t', 'con1', 'ca1t', '4ing.', 'm1m', '1ca', '1q', '1ble', 'om1', 'r1r', 'hena4', '.re1', 'n1g', 'at1', 'pu2', 'a1b', 'he2n', '1na', 'gr2', '1m', 'ter1', 'x1c', 'li1', '.ta4', 'hy3ph', 'hen5at', 'n2at', 'io3n.', 'a2n', '3ty.', 'b2l', 'ex1', 'l1l', 'e2x', 'p2h', 's1s', '.un1', '2io', 'an1d'], ['pro-ject', 'mis-sis-sip-pi', 'ex-cep-tion'], 3, 3], 'cat-egory'), ('control layout', ['table', ['e2x', '3ty.', '1tio', 'p2h', 'he2n', 'li1', '.un1', 'con1', '1ca', 'hy3ph', 'm1m', 'b2l', 'r1r', 'io3n.', 'c2ce', 'ca1t'], ['mis-sis-sip-pi', 'ex-cep-tion'], 2, 1], 'table')], [('regression: competing digit resolution', ['Commitment', ['b2l', 'pu2', 'e1c', 'li1', 'e2x', 'r1r', 'ex1', '1ble', 'm1m', '1tio', 'con1', 'he2n', '1q', '1ca', 'p2h', '5nd.', 'o2n', 'ment1', '2io', 'n2at', '3ty.', '.un1', '.re1', 'om1', 'a1b', '1m', 's1s', 'ca1t', 'hy3ph'], ['ta-ble', 'mis-sis-sip-pi'], 3, 2], 'Com-mit-ment'), ('regression: competing digit resolution', ['Table', ['ca1t', '2io', '.re1', 'ex1', 'io3n.', '.un1', 'x1c', 'he2n', 'c2ce', 'a1b', '.ta4', 'gr2', 't1t', '1m', '1ble', 'an1d', 'om1', '4ing.', 'o2n', 'a2n', '5nd.', 'pu2', 'n1g', 's1s', 'con1', 'hena4', 'e2x', 'ter1', '2mp', 'hen5at', 'e1c', 'm1m', 'p2h', 'ment1', '1p', '1q', '1na', '3ty.', '1ca', 'at1', 'b2l', 'n2at'], ['gram-mar', 'ex-cep-tion', 'pro-ject'], 1, 1], 'Table'), ('partial-repair probe', ['battle', ['con1', 'e1c', 't1t', 'om1', 'ca1t', 'he2n', 'o2n', 'x1c', '1ca', 'e2x', 'ex1', 'b2l', 'li1', '1m', 'r1r', 'at1', 'a1b'], [], 2, 3], 'bat-tle'), ('regression: competing digit resolution', ['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'), ('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'), ('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'), ('control layout', ['running', ['.ta4', 'a2n', 'hena4', 's1s', '2io', 'hen5at', 'e1c', '1p', 'e2x', 'n2at', '.un1', 'hy3ph', 'con1', 'a1b', '1m', '.re1', 'b2l'], [], 2, 2], 'running'), ('control layout', ['Paragraph', ['hena4', 's1s', 'p2h', 'hen5at', '1tio', 'con1', '3ty.', 'x1c', 'e2x', 'o2n', '.re1', '2io', 't1t', '4ing.', '.ta4', '5nd.', 'io3n.', '1ca', 'an1d', '1q', 'ex1', 'at1', '1m', 'gr2', 'ment1', 'hy3ph', 'r1r', '1na', 'pu2', 'om1', 'n2at'], ['pro-ject', 'ex-cep-tion', 'mis-sis-sip-pi'], 1, 2], 'Paragraph')], [('regression: competing digit resolution', ['connection', ['om1', '1ca', '.ta4', 'gr2', 'an1d', '3ty.', 's1s', '2mp', 'p2h', 'a1b', 'con1', 'pu2', 'hena4', '4ing.', 'r1r', '5nd.', 'e2x', '1na', 'hy3ph', '.un1', '1tio', 'c2ce', 'li1', 'l1l', 'ter1', 'o2n', 'he2n', 'ex1', 'a2n', '.re1', 'n2at'], ['ta-ble', 'mis-sis-sip-pi'], 1, 2], 'con-nec-tion'), ('regression: competing digit resolution', ['literally', ['hena4', 'li1', '5nd.', 'om1', 'ex1', 'pu2', '1na', 'ca1t', 'hen5at', 'p2h', 'b2l', 'hy3ph', 's1s', 'ter1'], ['mis-sis-sip-pi'], 1, 3], 'li-ter-ally'), ('regression: competing digit resolution', ['hyphenation', ['c2ce', '1ble', '2mp', 'a1b', '1q', 'n1g', 'a2n', '3ty.', 'o2n', 't1t', '1na', '4ing.', 'he2n', 'ment1', 'io3n.', 'e2x', 'hen5at', 'ter1', 'hy3ph', 's1s', 'pu2', 'ca1t', '.re1', '1m', 'con1', 'm1m', 'p2h', '5nd.', 'li1', 'r1r', '1tio', 'b2l', 'l1l', 'at1', 'ex1', 'om1', '.un1', 'e1c', 'gr2', '.ta4', 'an1d', 'x1c', '1p', 'hena4', '2io', '1ca', 'n2at'], ['gram-mar'], 2, 3], 'hy-phen-ation'), ('regression: competing digit resolution', ['hyphenation', ['1ble', '1ca', 'hy3ph', 'gr2', '5nd.', 'at1', '1tio', 'n2at', 'ex1', 'x1c', '1na', 'ter1', 'b2l', 'e1c', 't1t', '1q', 'li1', '.ta4', 'm1m', 's1s', 'e2x', 'con1', '2mp', 'r1r', 'hena4', '.re1', '2io', 'c2ce', 'om1', 'p2h', '1p', 'ca1t', 'l1l', 'o2n', 'pu2', 'n1g', 'a1b', 'io3n.', '1m', 'ment1'], ['mis-sis-sip-pi', 'ta-ble'], 1, 1], 'hy-phe-natio-n'), ('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', ['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'), ('control layout', ['terminal', ['hen5at', 'con1', 'a2n', 'gr2', '1m', 'at1', '.re1', 'n1g', 'e2x', '4ing.', '.ta4', 'p2h'], [], 3, 2], 'ter-minal')], [('regression: competing digit resolution', ['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'), ('regression: competing digit resolution', ['Commitment', ['3ty.', '4ing.', '1ca', '5nd.', 's1s', 'a1b', '.un1', 'n2at', 'pu2', 'a2n', 'x1c', 'io3n.', 'ex1', 'n1g', '2io', 'b2l', 'at1', '1na', 'li1', 'c2ce', '1m', 'r1r', 'm1m', 'gr2', 'e2x', 'p2h', 'con1', 'ment1', 'he2n', 'ter1', 'hena4', '1p', 'an1d', 'e1c', '1tio', 't1t', '1q', '1ble', '.re1', 'hy3ph', 'om1', '2mp', 'ca1t', 'o2n', 'l1l', 'hen5at', '.ta4'], ['gram-mar', 'mis-sis-sip-pi', 'ta-ble'], 3, 3], 'Com-mit-ment'), ('regression: competing digit resolution', ['computer', ['1tio', 'om1', 'a1b', 't1t', 'he2n', 'e1c', 'ment1', 'io3n.', '1ble', 'b2l', 'an1d', '2mp', 'pu2', 'o2n', '3ty.', 'l1l', '1na', 'hena4', 'hy3ph', '.ta4', 'con1', 'ex1', 'at1', 'r1r', 'ter1', '5nd.', 'li1', 'ca1t', '1p', '1ca', 'gr2', 'n2at', '.re1', '4ing.', '1m', '.un1', 'a2n', 'x1c', 'e2x', 'n1g', '1q', '2io', 's1s', 'c2ce'], [], 1, 1], 'com-puter'), ('partial-repair probe', ['Recreation', ['4ing.', 'r1r', '.ta4', 't1t', 'pu2', 'ter1', 'at1', 'c2ce', '2mp', 'li1', 'l1l', '1m', 'a1b', 'n2at', '.un1', 'n1g', 'm1m', 'hy3ph', 'e2x', 'om1', '1ble', 'a2n', 'x1c', 'he2n', '1tio', '.re1', 'ca1t', '1ca', '2io', 'gr2', 's1s', '1q', 'io3n.', 'o2n', 'hen5at', 'p2h', '3ty.', 'ex1', 'e1c', '1na', 'b2l'], ['ta-ble', 'gram-mar', 'pro-ject'], 1, 3], 'Re-crea-tion'), ('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'), ('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', ['grammar', ['l1l', '5nd.', 'ter1', 'gr2', 't1t', 'ex1', 'b2l', 'om1', 'a2n', 'm1m', 'n1g', 'p2h', '1tio', 'hen5at', '1ca', '.ta4', 'n2at', '1na', 'hena4', '.re1', 'ment1', 'e2x', 'c2ce', '2mp', 'ca1t', '4ing.', 'r1r', 'io3n.', 'x1c'], [], 2, 2], 'gram-mar'), ('control layout', ['Mississippi', ['b2l', 't1t', 'o2n', 'io3n.', 'ment1', 'hen5at', 'hy3ph', 'hena4', 'con1', 's1s', '.re1', 'ca1t', 'li1', '4ing.', 'l1l', '2mp', 'e2x', 'om1'], ['gram-mar', 'pro-ject', 'ta-ble'], 1, 2], 'Mis-sis-sippi')]]\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":"42792e5e7a44470875ea542998841dc394e2eb3d9b62fbe05eec833d208e34d7","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] = 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 = [[('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'), ('regression: competing digit resolution', ['Commitment', ['pu2', '.re1', 'b2l', '2io', 'o2n', 'an1d', 'at1', 'a2n', '1m', 'l1l', 'ca1t', 'con1', 'e2x', 'ter1', 'n2at', 't1t', 'hen5at', '1p', '1q', '3ty.', 'ment1', 'ex1', '1na', 'hy3ph', 's1s'], ['ta-ble', 'pro-ject'], 3, 3], 'Com-mit-ment'), ('partial-repair probe', ['Recreation', ['.re1', '5nd.', 'li1', 'ment1', 'o2n', 'hen5at', 's1s', 'n1g', 'ca1t', 'io3n.', 'e2x', '1na', 'c2ce', '1tio', '1p', '2io', 'l1l', 'hena4', 'm1m', 'a2n', 'hy3ph', 'om1', '1m', 'a1b', '.ta4', 'an1d', '.un1', 't1t', 'x1c', 'pu2', 'he2n', 'b2l', 'at1', 'con1', '1q', 'r1r', 'ter1'], [], 2, 2], 'Re-crea-tion'), ('regression: competing digit resolution', ['hyphenation', ['1m', 'n2at', '3ty.', '1tio', '2io', 't1t', 'a2n', 'ca1t', '1p', 'x1c', '1na', '.un1', 'he2n', 'm1m', 'e1c', 'con1', 's1s', 'ex1', '4ing.', 'c2ce', 'hen5at', '1q', 'an1d', 'p2h', 'gr2', '2mp', 'hy3ph', 'l1l', 'r1r', 'n1g', 'ment1', 'ter1', '.re1', 'io3n.', 'at1', '.ta4', '1ble', 'b2l', 'o2n', 'e2x', 'li1', '1ca'], ['gram-mar'], 3, 2], 'hyphen-a-tion'), ('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'), ('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', ['Recreation', ['o2n', '.re1', 't1t', '4ing.', 'l1l', 'm1m', 'gr2', 'li1', 'ter1', '2io'], ['ta-ble', 'ex-cep-tion', 'mis-sis-sip-pi'], 2, 3], 'Re-creation'), ('control layout', ['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')], [('regression: competing digit resolution', ['Recreation', ['2io', 'li1', 'io3n.', 'a2n', 'ment1', 'n1g', 'e1c', 'ter1', '1q', 'x1c', 'he2n', 'p2h', '1tio', '4ing.', 'm1m', '.re1', 'o2n', 'gr2', 'l1l', '1na', 'om1', '.ta4', 'hena4', '.un1', '1ble', 'con1', '1m', 'ex1', 'hen5at', 'pu2', 'n2at', 'hy3ph', '1ca'], ['pro-ject'], 3, 1], 'Recrea-tio-n'), ('regression: competing digit resolution', ['Table', ['ca1t', '2io', '.re1', 'ex1', 'io3n.', '.un1', 'x1c', 'he2n', 'c2ce', 'a1b', '.ta4', 'gr2', 't1t', '1m', '1ble', 'an1d', 'om1', '4ing.', 'o2n', 'a2n', '5nd.', 'pu2', 'n1g', 's1s', 'con1', 'hena4', 'e2x', 'ter1', '2mp', 'hen5at', 'e1c', 'm1m', 'p2h', 'ment1', '1p', '1q', '1na', '3ty.', '1ca', 'at1', 'b2l', 'n2at'], ['gram-mar', 'ex-cep-tion', 'pro-ject'], 1, 1], 'Table'), ('regression: competing digit resolution', ['hyphenation', ['e2x', 'he2n', 'ex1', 'hy3ph', 'io3n.', '5nd.', 'con1', 'om1', '.un1', 'm1m', 'pu2', '1ca', 'n1g', 'ca1t', 'n2at', '2io', '1tio', '4ing.', 's1s', '2mp', 'e1c', 'at1', 't1t', 'x1c', 'hena4', 'ter1', 'ment1', 'gr2', '1m', '1p', 'b2l', 'c2ce', '.re1', '1ble', 'r1r', '.ta4', 'hen5at', 'a1b', 'p2h', '1q'], [], 1, 2], 'hy-phen-ation'), ('regression: competing digit resolution', ['computer', ['1tio', 'om1', 'a1b', 't1t', 'he2n', 'e1c', 'ment1', 'io3n.', '1ble', 'b2l', 'an1d', '2mp', 'pu2', 'o2n', '3ty.', 'l1l', '1na', 'hena4', 'hy3ph', '.ta4', 'con1', 'ex1', 'at1', 'r1r', 'ter1', '5nd.', 'li1', 'ca1t', '1p', '1ca', 'gr2', 'n2at', '.re1', '4ing.', '1m', '.un1', 'a2n', 'x1c', 'e2x', 'n1g', '1q', '2io', 's1s', 'c2ce'], [], 1, 1], 'com-puter'), ('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'), ('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'), ('control layout', ['category', ['o2n', '2mp', 'ment1', 't1t', 'con1', 'ca1t', '4ing.', 'm1m', '1ca', '1q', '1ble', 'om1', 'r1r', 'hena4', '.re1', 'n1g', 'at1', 'pu2', 'a1b', 'he2n', '1na', 'gr2', '1m', 'ter1', 'x1c', 'li1', '.ta4', 'hy3ph', 'hen5at', 'n2at', 'io3n.', 'a2n', '3ty.', 'b2l', 'ex1', 'l1l', 'e2x', 'p2h', 's1s', '.un1', '2io', 'an1d'], ['pro-ject', 'mis-sis-sip-pi', 'ex-cep-tion'], 3, 3], 'cat-egory'), ('control layout', ['table', ['e2x', '3ty.', '1tio', 'p2h', 'he2n', 'li1', '.un1', 'con1', '1ca', 'hy3ph', 'm1m', 'b2l', 'r1r', 'io3n.', 'c2ce', 'ca1t'], ['mis-sis-sip-pi', 'ex-cep-tion'], 2, 1], 'table')], [('regression: competing digit resolution', ['Commitment', ['b2l', 'pu2', 'e1c', 'li1', 'e2x', 'r1r', 'ex1', '1ble', 'm1m', '1tio', 'con1', 'he2n', '1q', '1ca', 'p2h', '5nd.', 'o2n', 'ment1', '2io', 'n2at', '3ty.', '.un1', '.re1', 'om1', 'a1b', '1m', 's1s', 'ca1t', 'hy3ph'], ['ta-ble', 'mis-sis-sip-pi'], 3, 2], 'Com-mit-ment'), ('regression: competing digit resolution', ['Table', ['ca1t', '2io', '.re1', 'ex1', 'io3n.', '.un1', 'x1c', 'he2n', 'c2ce', 'a1b', '.ta4', 'gr2', 't1t', '1m', '1ble', 'an1d', 'om1', '4ing.', 'o2n', 'a2n', '5nd.', 'pu2', 'n1g', 's1s', 'con1', 'hena4', 'e2x', 'ter1', '2mp', 'hen5at', 'e1c', 'm1m', 'p2h', 'ment1', '1p', '1q', '1na', '3ty.', '1ca', 'at1', 'b2l', 'n2at'], ['gram-mar', 'ex-cep-tion', 'pro-ject'], 1, 1], 'Table'), ('partial-repair probe', ['battle', ['con1', 'e1c', 't1t', 'om1', 'ca1t', 'he2n', 'o2n', 'x1c', '1ca', 'e2x', 'ex1', 'b2l', 'li1', '1m', 'r1r', 'at1', 'a1b'], [], 2, 3], 'bat-tle'), ('regression: competing digit resolution', ['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'), ('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'), ('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'), ('control layout', ['running', ['.ta4', 'a2n', 'hena4', 's1s', '2io', 'hen5at', 'e1c', '1p', 'e2x', 'n2at', '.un1', 'hy3ph', 'con1', 'a1b', '1m', '.re1', 'b2l'], [], 2, 2], 'running'), ('control layout', ['Paragraph', ['hena4', 's1s', 'p2h', 'hen5at', '1tio', 'con1', '3ty.', 'x1c', 'e2x', 'o2n', '.re1', '2io', 't1t', '4ing.', '.ta4', '5nd.', 'io3n.', '1ca', 'an1d', '1q', 'ex1', 'at1', '1m', 'gr2', 'ment1', 'hy3ph', 'r1r', '1na', 'pu2', 'om1', 'n2at'], ['pro-ject', 'ex-cep-tion', 'mis-sis-sip-pi'], 1, 2], 'Paragraph')], [('regression: competing digit resolution', ['connection', ['om1', '1ca', '.ta4', 'gr2', 'an1d', '3ty.', 's1s', '2mp', 'p2h', 'a1b', 'con1', 'pu2', 'hena4', '4ing.', 'r1r', '5nd.', 'e2x', '1na', 'hy3ph', '.un1', '1tio', 'c2ce', 'li1', 'l1l', 'ter1', 'o2n', 'he2n', 'ex1', 'a2n', '.re1', 'n2at'], ['ta-ble', 'mis-sis-sip-pi'], 1, 2], 'con-nec-tion'), ('regression: competing digit resolution', ['literally', ['hena4', 'li1', '5nd.', 'om1', 'ex1', 'pu2', '1na', 'ca1t', 'hen5at', 'p2h', 'b2l', 'hy3ph', 's1s', 'ter1'], ['mis-sis-sip-pi'], 1, 3], 'li-ter-ally'), ('regression: competing digit resolution', ['hyphenation', ['c2ce', '1ble', '2mp', 'a1b', '1q', 'n1g', 'a2n', '3ty.', 'o2n', 't1t', '1na', '4ing.', 'he2n', 'ment1', 'io3n.', 'e2x', 'hen5at', 'ter1', 'hy3ph', 's1s', 'pu2', 'ca1t', '.re1', '1m', 'con1', 'm1m', 'p2h', '5nd.', 'li1', 'r1r', '1tio', 'b2l', 'l1l', 'at1', 'ex1', 'om1', '.un1', 'e1c', 'gr2', '.ta4', 'an1d', 'x1c', '1p', 'hena4', '2io', '1ca', 'n2at'], ['gram-mar'], 2, 3], 'hy-phen-ation'), ('regression: competing digit resolution', ['hyphenation', ['1ble', '1ca', 'hy3ph', 'gr2', '5nd.', 'at1', '1tio', 'n2at', 'ex1', 'x1c', '1na', 'ter1', 'b2l', 'e1c', 't1t', '1q', 'li1', '.ta4', 'm1m', 's1s', 'e2x', 'con1', '2mp', 'r1r', 'hena4', '.re1', '2io', 'c2ce', 'om1', 'p2h', '1p', 'ca1t', 'l1l', 'o2n', 'pu2', 'n1g', 'a1b', 'io3n.', '1m', 'ment1'], ['mis-sis-sip-pi', 'ta-ble'], 1, 1], 'hy-phe-natio-n'), ('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', ['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'), ('control layout', ['terminal', ['hen5at', 'con1', 'a2n', 'gr2', '1m', 'at1', '.re1', 'n1g', 'e2x', '4ing.', '.ta4', 'p2h'], [], 3, 2], 'ter-minal')], [('regression: competing digit resolution', ['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'), ('regression: competing digit resolution', ['Commitment', ['3ty.', '4ing.', '1ca', '5nd.', 's1s', 'a1b', '.un1', 'n2at', 'pu2', 'a2n', 'x1c', 'io3n.', 'ex1', 'n1g', '2io', 'b2l', 'at1', '1na', 'li1', 'c2ce', '1m', 'r1r', 'm1m', 'gr2', 'e2x', 'p2h', 'con1', 'ment1', 'he2n', 'ter1', 'hena4', '1p', 'an1d', 'e1c', '1tio', 't1t', '1q', '1ble', '.re1', 'hy3ph', 'om1', '2mp', 'ca1t', 'o2n', 'l1l', 'hen5at', '.ta4'], ['gram-mar', 'mis-sis-sip-pi', 'ta-ble'], 3, 3], 'Com-mit-ment'), ('regression: competing digit resolution', ['computer', ['1tio', 'om1', 'a1b', 't1t', 'he2n', 'e1c', 'ment1', 'io3n.', '1ble', 'b2l', 'an1d', '2mp', 'pu2', 'o2n', '3ty.', 'l1l', '1na', 'hena4', 'hy3ph', '.ta4', 'con1', 'ex1', 'at1', 'r1r', 'ter1', '5nd.', 'li1', 'ca1t', '1p', '1ca', 'gr2', 'n2at', '.re1', '4ing.', '1m', '.un1', 'a2n', 'x1c', 'e2x', 'n1g', '1q', '2io', 's1s', 'c2ce'], [], 1, 1], 'com-puter'), ('partial-repair probe', ['Recreation', ['4ing.', 'r1r', '.ta4', 't1t', 'pu2', 'ter1', 'at1', 'c2ce', '2mp', 'li1', 'l1l', '1m', 'a1b', 'n2at', '.un1', 'n1g', 'm1m', 'hy3ph', 'e2x', 'om1', '1ble', 'a2n', 'x1c', 'he2n', '1tio', '.re1', 'ca1t', '1ca', '2io', 'gr2', 's1s', '1q', 'io3n.', 'o2n', 'hen5at', 'p2h', '3ty.', 'ex1', 'e1c', '1na', 'b2l'], ['ta-ble', 'gram-mar', 'pro-ject'], 1, 3], 'Re-crea-tion'), ('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'), ('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', ['grammar', ['l1l', '5nd.', 'ter1', 'gr2', 't1t', 'ex1', 'b2l', 'om1', 'a2n', 'm1m', 'n1g', 'p2h', '1tio', 'hen5at', '1ca', '.ta4', 'n2at', '1na', 'hena4', '.re1', 'ment1', 'e2x', 'c2ce', '2mp', 'ca1t', '4ing.', 'r1r', 'io3n.', 'x1c'], [], 2, 2], 'gram-mar'), ('control layout', ['Mississippi', ['b2l', 't1t', 'o2n', 'io3n.', 'ment1', 'hen5at', 'hy3ph', 'hena4', 'con1', 's1s', '.re1', 'ca1t', 'li1', '4ing.', 'l1l', '2mp', 'e2x', 'om1'], ['gram-mar', 'pro-ject', 'ta-ble'], 1, 2], 'Mis-sis-sippi')]]\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":"95ff4bcdcea91ccb864d29ae0e72782c5671b9579d3b4cd3fdb953b5a5fa2163","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 = [[('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'), ('regression: competing digit resolution', ['Commitment', ['pu2', '.re1', 'b2l', '2io', 'o2n', 'an1d', 'at1', 'a2n', '1m', 'l1l', 'ca1t', 'con1', 'e2x', 'ter1', 'n2at', 't1t', 'hen5at', '1p', '1q', '3ty.', 'ment1', 'ex1', '1na', 'hy3ph', 's1s'], ['ta-ble', 'pro-ject'], 3, 3], 'Com-mit-ment'), ('partial-repair probe', ['Recreation', ['.re1', '5nd.', 'li1', 'ment1', 'o2n', 'hen5at', 's1s', 'n1g', 'ca1t', 'io3n.', 'e2x', '1na', 'c2ce', '1tio', '1p', '2io', 'l1l', 'hena4', 'm1m', 'a2n', 'hy3ph', 'om1', '1m', 'a1b', '.ta4', 'an1d', '.un1', 't1t', 'x1c', 'pu2', 'he2n', 'b2l', 'at1', 'con1', '1q', 'r1r', 'ter1'], [], 2, 2], 'Re-crea-tion'), ('regression: competing digit resolution', ['hyphenation', ['1m', 'n2at', '3ty.', '1tio', '2io', 't1t', 'a2n', 'ca1t', '1p', 'x1c', '1na', '.un1', 'he2n', 'm1m', 'e1c', 'con1', 's1s', 'ex1', '4ing.', 'c2ce', 'hen5at', '1q', 'an1d', 'p2h', 'gr2', '2mp', 'hy3ph', 'l1l', 'r1r', 'n1g', 'ment1', 'ter1', '.re1', 'io3n.', 'at1', '.ta4', '1ble', 'b2l', 'o2n', 'e2x', 'li1', '1ca'], ['gram-mar'], 3, 2], 'hyphen-a-tion'), ('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'), ('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', ['Recreation', ['o2n', '.re1', 't1t', '4ing.', 'l1l', 'm1m', 'gr2', 'li1', 'ter1', '2io'], ['ta-ble', 'ex-cep-tion', 'mis-sis-sip-pi'], 2, 3], 'Re-creation'), ('control layout', ['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')], [('regression: competing digit resolution', ['Recreation', ['2io', 'li1', 'io3n.', 'a2n', 'ment1', 'n1g', 'e1c', 'ter1', '1q', 'x1c', 'he2n', 'p2h', '1tio', '4ing.', 'm1m', '.re1', 'o2n', 'gr2', 'l1l', '1na', 'om1', '.ta4', 'hena4', '.un1', '1ble', 'con1', '1m', 'ex1', 'hen5at', 'pu2', 'n2at', 'hy3ph', '1ca'], ['pro-ject'], 3, 1], 'Recrea-tio-n'), ('regression: competing digit resolution', ['Table', ['ca1t', '2io', '.re1', 'ex1', 'io3n.', '.un1', 'x1c', 'he2n', 'c2ce', 'a1b', '.ta4', 'gr2', 't1t', '1m', '1ble', 'an1d', 'om1', '4ing.', 'o2n', 'a2n', '5nd.', 'pu2', 'n1g', 's1s', 'con1', 'hena4', 'e2x', 'ter1', '2mp', 'hen5at', 'e1c', 'm1m', 'p2h', 'ment1', '1p', '1q', '1na', '3ty.', '1ca', 'at1', 'b2l', 'n2at'], ['gram-mar', 'ex-cep-tion', 'pro-ject'], 1, 1], 'Table'), ('regression: competing digit resolution', ['hyphenation', ['e2x', 'he2n', 'ex1', 'hy3ph', 'io3n.', '5nd.', 'con1', 'om1', '.un1', 'm1m', 'pu2', '1ca', 'n1g', 'ca1t', 'n2at', '2io', '1tio', '4ing.', 's1s', '2mp', 'e1c', 'at1', 't1t', 'x1c', 'hena4', 'ter1', 'ment1', 'gr2', '1m', '1p', 'b2l', 'c2ce', '.re1', '1ble', 'r1r', '.ta4', 'hen5at', 'a1b', 'p2h', '1q'], [], 1, 2], 'hy-phen-ation'), ('regression: competing digit resolution', ['computer', ['1tio', 'om1', 'a1b', 't1t', 'he2n', 'e1c', 'ment1', 'io3n.', '1ble', 'b2l', 'an1d', '2mp', 'pu2', 'o2n', '3ty.', 'l1l', '1na', 'hena4', 'hy3ph', '.ta4', 'con1', 'ex1', 'at1', 'r1r', 'ter1', '5nd.', 'li1', 'ca1t', '1p', '1ca', 'gr2', 'n2at', '.re1', '4ing.', '1m', '.un1', 'a2n', 'x1c', 'e2x', 'n1g', '1q', '2io', 's1s', 'c2ce'], [], 1, 1], 'com-puter'), ('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'), ('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'), ('control layout', ['category', ['o2n', '2mp', 'ment1', 't1t', 'con1', 'ca1t', '4ing.', 'm1m', '1ca', '1q', '1ble', 'om1', 'r1r', 'hena4', '.re1', 'n1g', 'at1', 'pu2', 'a1b', 'he2n', '1na', 'gr2', '1m', 'ter1', 'x1c', 'li1', '.ta4', 'hy3ph', 'hen5at', 'n2at', 'io3n.', 'a2n', '3ty.', 'b2l', 'ex1', 'l1l', 'e2x', 'p2h', 's1s', '.un1', '2io', 'an1d'], ['pro-ject', 'mis-sis-sip-pi', 'ex-cep-tion'], 3, 3], 'cat-egory'), ('control layout', ['table', ['e2x', '3ty.', '1tio', 'p2h', 'he2n', 'li1', '.un1', 'con1', '1ca', 'hy3ph', 'm1m', 'b2l', 'r1r', 'io3n.', 'c2ce', 'ca1t'], ['mis-sis-sip-pi', 'ex-cep-tion'], 2, 1], 'table')], [('regression: competing digit resolution', ['Commitment', ['b2l', 'pu2', 'e1c', 'li1', 'e2x', 'r1r', 'ex1', '1ble', 'm1m', '1tio', 'con1', 'he2n', '1q', '1ca', 'p2h', '5nd.', 'o2n', 'ment1', '2io', 'n2at', '3ty.', '.un1', '.re1', 'om1', 'a1b', '1m', 's1s', 'ca1t', 'hy3ph'], ['ta-ble', 'mis-sis-sip-pi'], 3, 2], 'Com-mit-ment'), ('regression: competing digit resolution', ['Table', ['ca1t', '2io', '.re1', 'ex1', 'io3n.', '.un1', 'x1c', 'he2n', 'c2ce', 'a1b', '.ta4', 'gr2', 't1t', '1m', '1ble', 'an1d', 'om1', '4ing.', 'o2n', 'a2n', '5nd.', 'pu2', 'n1g', 's1s', 'con1', 'hena4', 'e2x', 'ter1', '2mp', 'hen5at', 'e1c', 'm1m', 'p2h', 'ment1', '1p', '1q', '1na', '3ty.', '1ca', 'at1', 'b2l', 'n2at'], ['gram-mar', 'ex-cep-tion', 'pro-ject'], 1, 1], 'Table'), ('partial-repair probe', ['battle', ['con1', 'e1c', 't1t', 'om1', 'ca1t', 'he2n', 'o2n', 'x1c', '1ca', 'e2x', 'ex1', 'b2l', 'li1', '1m', 'r1r', 'at1', 'a1b'], [], 2, 3], 'bat-tle'), ('regression: competing digit resolution', ['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'), ('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'), ('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'), ('control layout', ['running', ['.ta4', 'a2n', 'hena4', 's1s', '2io', 'hen5at', 'e1c', '1p', 'e2x', 'n2at', '.un1', 'hy3ph', 'con1', 'a1b', '1m', '.re1', 'b2l'], [], 2, 2], 'running'), ('control layout', ['Paragraph', ['hena4', 's1s', 'p2h', 'hen5at', '1tio', 'con1', '3ty.', 'x1c', 'e2x', 'o2n', '.re1', '2io', 't1t', '4ing.', '.ta4', '5nd.', 'io3n.', '1ca', 'an1d', '1q', 'ex1', 'at1', '1m', 'gr2', 'ment1', 'hy3ph', 'r1r', '1na', 'pu2', 'om1', 'n2at'], ['pro-ject', 'ex-cep-tion', 'mis-sis-sip-pi'], 1, 2], 'Paragraph')], [('regression: competing digit resolution', ['connection', ['om1', '1ca', '.ta4', 'gr2', 'an1d', '3ty.', 's1s', '2mp', 'p2h', 'a1b', 'con1', 'pu2', 'hena4', '4ing.', 'r1r', '5nd.', 'e2x', '1na', 'hy3ph', '.un1', '1tio', 'c2ce', 'li1', 'l1l', 'ter1', 'o2n', 'he2n', 'ex1', 'a2n', '.re1', 'n2at'], ['ta-ble', 'mis-sis-sip-pi'], 1, 2], 'con-nec-tion'), ('regression: competing digit resolution', ['literally', ['hena4', 'li1', '5nd.', 'om1', 'ex1', 'pu2', '1na', 'ca1t', 'hen5at', 'p2h', 'b2l', 'hy3ph', 's1s', 'ter1'], ['mis-sis-sip-pi'], 1, 3], 'li-ter-ally'), ('regression: competing digit resolution', ['hyphenation', ['c2ce', '1ble', '2mp', 'a1b', '1q', 'n1g', 'a2n', '3ty.', 'o2n', 't1t', '1na', '4ing.', 'he2n', 'ment1', 'io3n.', 'e2x', 'hen5at', 'ter1', 'hy3ph', 's1s', 'pu2', 'ca1t', '.re1', '1m', 'con1', 'm1m', 'p2h', '5nd.', 'li1', 'r1r', '1tio', 'b2l', 'l1l', 'at1', 'ex1', 'om1', '.un1', 'e1c', 'gr2', '.ta4', 'an1d', 'x1c', '1p', 'hena4', '2io', '1ca', 'n2at'], ['gram-mar'], 2, 3], 'hy-phen-ation'), ('regression: competing digit resolution', ['hyphenation', ['1ble', '1ca', 'hy3ph', 'gr2', '5nd.', 'at1', '1tio', 'n2at', 'ex1', 'x1c', '1na', 'ter1', 'b2l', 'e1c', 't1t', '1q', 'li1', '.ta4', 'm1m', 's1s', 'e2x', 'con1', '2mp', 'r1r', 'hena4', '.re1', '2io', 'c2ce', 'om1', 'p2h', '1p', 'ca1t', 'l1l', 'o2n', 'pu2', 'n1g', 'a1b', 'io3n.', '1m', 'ment1'], ['mis-sis-sip-pi', 'ta-ble'], 1, 1], 'hy-phe-natio-n'), ('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', ['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'), ('control layout', ['terminal', ['hen5at', 'con1', 'a2n', 'gr2', '1m', 'at1', '.re1', 'n1g', 'e2x', '4ing.', '.ta4', 'p2h'], [], 3, 2], 'ter-minal')], [('regression: competing digit resolution', ['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'), ('regression: competing digit resolution', ['Commitment', ['3ty.', '4ing.', '1ca', '5nd.', 's1s', 'a1b', '.un1', 'n2at', 'pu2', 'a2n', 'x1c', 'io3n.', 'ex1', 'n1g', '2io', 'b2l', 'at1', '1na', 'li1', 'c2ce', '1m', 'r1r', 'm1m', 'gr2', 'e2x', 'p2h', 'con1', 'ment1', 'he2n', 'ter1', 'hena4', '1p', 'an1d', 'e1c', '1tio', 't1t', '1q', '1ble', '.re1', 'hy3ph', 'om1', '2mp', 'ca1t', 'o2n', 'l1l', 'hen5at', '.ta4'], ['gram-mar', 'mis-sis-sip-pi', 'ta-ble'], 3, 3], 'Com-mit-ment'), ('regression: competing digit resolution', ['computer', ['1tio', 'om1', 'a1b', 't1t', 'he2n', 'e1c', 'ment1', 'io3n.', '1ble', 'b2l', 'an1d', '2mp', 'pu2', 'o2n', '3ty.', 'l1l', '1na', 'hena4', 'hy3ph', '.ta4', 'con1', 'ex1', 'at1', 'r1r', 'ter1', '5nd.', 'li1', 'ca1t', '1p', '1ca', 'gr2', 'n2at', '.re1', '4ing.', '1m', '.un1', 'a2n', 'x1c', 'e2x', 'n1g', '1q', '2io', 's1s', 'c2ce'], [], 1, 1], 'com-puter'), ('partial-repair probe', ['Recreation', ['4ing.', 'r1r', '.ta4', 't1t', 'pu2', 'ter1', 'at1', 'c2ce', '2mp', 'li1', 'l1l', '1m', 'a1b', 'n2at', '.un1', 'n1g', 'm1m', 'hy3ph', 'e2x', 'om1', '1ble', 'a2n', 'x1c', 'he2n', '1tio', '.re1', 'ca1t', '1ca', '2io', 'gr2', 's1s', '1q', 'io3n.', 'o2n', 'hen5at', 'p2h', '3ty.', 'ex1', 'e1c', '1na', 'b2l'], ['ta-ble', 'gram-mar', 'pro-ject'], 1, 3], 'Re-crea-tion'), ('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'), ('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', ['grammar', ['l1l', '5nd.', 'ter1', 'gr2', 't1t', 'ex1', 'b2l', 'om1', 'a2n', 'm1m', 'n1g', 'p2h', '1tio', 'hen5at', '1ca', '.ta4', 'n2at', '1na', 'hena4', '.re1', 'ment1', 'e2x', 'c2ce', '2mp', 'ca1t', '4ing.', 'r1r', 'io3n.', 'x1c'], [], 2, 2], 'gram-mar'), ('control layout', ['Mississippi', ['b2l', 't1t', 'o2n', 'io3n.', 'ment1', 'hen5at', 'hy3ph', 'hena4', 'con1', 's1s', '.re1', 'ca1t', 'li1', '4ing.', 'l1l', '2mp', 'e2x', 'om1'], ['gram-mar', 'pro-ject', 'ta-ble'], 1, 2], 'Mis-sis-sippi')]]\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-competing-digit-resolution","generated_at":"2026-09-29T14:49:48.941545+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":"Keep the maximum digit contributed to each gap.","root_cause":"Each matched pattern overwrites the gap value instead of keeping the maximum.","sha256":"26f35109e630c3f98ffef5c37d1663ef55e28e0cdee76a60eae47e628c5932c1","title":"Pattern-based hyphenation: competing digit resolution · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.291,"exit_code":1,"observations":[{"actual":"ca-t-egory","check":"right minimum boundary","expected":"ca-t-egory","passed":true},{"actual":"Com-mit-ment","check":"regression: competing digit resolution","expected":"Com-mit-ment","passed":true},{"actual":"Re-crea-t-ion","check":"partial-repair probe","expected":"Re-crea-tion","passed":false},{"actual":"hyphe-n-a-t-ion","check":"regression: competing digit resolution","expected":"hyphen-a-tion","passed":false},{"actual":"pro-ject","check":"lowercase exception","expected":"pro-ject","passed":true},{"actual":"ex-cel-lent","check":"left minimum boundary","expected":"ex-cel-lent","passed":true},{"actual":"Re-creation","check":"control layout","expected":"Re-creation","passed":true},{"actual":"Paragraph","check":"control layout","expected":"Paragraph","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"right minimum boundary\", \"actual\": \"ca-t-egory\", \"expected\": \"ca-t-egory\", \"passed\": true}, {\"check\": \"regression: competing digit resolution\", \"actual\": \"Com-mit-ment\", \"expected\": \"Com-mit-ment\", \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": \"Re-crea-t-ion\", \"expected\": \"Re-crea-tion\", \"passed\": false}, {\"check\": \"regression: competing digit resolution\", \"actual\": \"hyphe-n-a-t-ion\", \"expected\": \"hyphen-a-tion\", \"passed\": false}, {\"check\": \"lowercase exception\", \"actual\": \"pro-ject\", \"expected\": \"pro-ject\", \"passed\": true}, {\"check\": \"left minimum boundary\", \"actual\": \"ex-cel-lent\", \"expected\": \"ex-cel-lent\", \"passed\": true}, {\"check\": \"control layout\", \"actual\": \"Re-creation\", \"expected\": \"Re-creation\", \"passed\": true}, {\"check\": \"control layout\", \"actual\": \"Paragraph\", \"expected\": \"Paragraph\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.746,"exit_code":1,"observations":[{"actual":"cat-egory","check":"right minimum boundary","expected":"ca-t-egory","passed":false},{"actual":"Com-mitment","check":"regression: competing digit resolution","expected":"Com-mit-ment","passed":false},{"actual":"Re-crea-tion","check":"partial-repair probe","expected":"Re-crea-tion","passed":true},{"actual":"hyphena-tion","check":"regression: competing digit resolution","expected":"hyphen-a-tion","passed":false},{"actual":"pro-ject","check":"lowercase exception","expected":"pro-ject","passed":true},{"actual":"ex-cel-lent","check":"left minimum boundary","expected":"ex-cel-lent","passed":true},{"actual":"Re-creation","check":"control layout","expected":"Re-creation","passed":true},{"actual":"Paragraph","check":"control layout","expected":"Paragraph","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"right minimum boundary\", \"actual\": \"cat-egory\", \"expected\": \"ca-t-egory\", \"passed\": false}, {\"check\": \"regression: competing digit resolution\", \"actual\": \"Com-mitment\", \"expected\": \"Com-mit-ment\", \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": \"Re-crea-tion\", \"expected\": \"Re-crea-tion\", \"passed\": true}, {\"check\": \"regression: competing digit resolution\", \"actual\": \"hyphena-tion\", \"expected\": \"hyphen-a-tion\", \"passed\": false}, {\"check\": \"lowercase exception\", \"actual\": \"pro-ject\", \"expected\": \"pro-ject\", \"passed\": true}, {\"check\": \"left minimum boundary\", \"actual\": \"ex-cel-lent\", \"expected\": \"ex-cel-lent\", \"passed\": true}, {\"check\": \"control layout\", \"actual\": \"Re-creation\", \"expected\": \"Re-creation\", \"passed\": true}, {\"check\": \"control layout\", \"actual\": \"Paragraph\", \"expected\": \"Paragraph\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.337,"exit_code":0,"observations":[{"actual":"ca-t-egory","check":"right minimum boundary","expected":"ca-t-egory","passed":true},{"actual":"Com-mit-ment","check":"regression: competing digit resolution","expected":"Com-mit-ment","passed":true},{"actual":"Re-crea-tion","check":"partial-repair probe","expected":"Re-crea-tion","passed":true},{"actual":"hyphen-a-tion","check":"regression: competing digit resolution","expected":"hyphen-a-tion","passed":true},{"actual":"pro-ject","check":"lowercase exception","expected":"pro-ject","passed":true},{"actual":"ex-cel-lent","check":"left minimum boundary","expected":"ex-cel-lent","passed":true},{"actual":"Re-creation","check":"control layout","expected":"Re-creation","passed":true},{"actual":"Paragraph","check":"control layout","expected":"Paragraph","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"right minimum boundary\", \"actual\": \"ca-t-egory\", \"expected\": \"ca-t-egory\", \"passed\": true}, {\"check\": \"regression: competing digit resolution\", \"actual\": \"Com-mit-ment\", \"expected\": \"Com-mit-ment\", \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": \"Re-crea-tion\", \"expected\": \"Re-crea-tion\", \"passed\": true}, {\"check\": \"regression: competing digit resolution\", \"actual\": \"hyphen-a-tion\", \"expected\": \"hyphen-a-tion\", \"passed\": true}, {\"check\": \"lowercase exception\", \"actual\": \"pro-ject\", \"expected\": \"pro-ject\", \"passed\": true}, {\"check\": \"left minimum boundary\", \"actual\": \"ex-cel-lent\", \"expected\": \"ex-cel-lent\", \"passed\": true}, {\"check\": \"control layout\", \"actual\": \"Re-creation\", \"expected\": \"Re-creation\", \"passed\": true}, {\"check\": \"control layout\", \"actual\": \"Paragraph\", \"expected\": \"Paragraph\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}