def setDecode(self, decodeTable):
self.decodeTable = decodeTable<EOL>todo = set(decodeTable)<EOL>maskLength = <NUM_LIT:0><EOL>lengthTable = {}<EOL>while todo:<EOL><INDENT>mask = (<NUM_LIT:1><<maskLength)-<NUM_LIT:1><EOL>splitSymbols = defaultdict(list)<EOL>for s in todo: splitSymbols[s&mask].append(s)<EOL>for s,subset in splitSymbols.items():<EOL><INDENT>if len(subset)==<NUM_LIT:1>:<EOL><INDENT>lengthTable[self.decodeTable[s]] = maskLength<EOL>todo.remove(s)<EOL><DEDENT><DEDENT>maskLength +=<NUM_LIT:1><EOL><DEDENT>self.lengthTable = lengthTable<EOL>self.minLength = min(lengthTable.values())<EOL>self.maxLength = max(lengthTable.values())<EOL>self.switchToPrefix()<EOL>
Store decodeTable,
        and compute lengthTable, minLength, maxLength from encodings.