def build_forward(self, out, endian): maps = self.load(twoDict(firstDict)) if out is not None: out.open(endian) try: self.blockout(out, range(0x21, 0x7f), range(0x21, 0x98), maps.fwd.get) finally: out.close() return maps.rev.items()
def build_forward(self, out, endian): maps = self.load(twoDict()) if out is not None: out.open(endian) # In the 0xFF x 0xFF character square, Big5 only uses character # positions in the 0x40 - 0xFE (columns) and 0xA1 - 0xF9 (rows) # area. We exploit this to shrink the table somewhat. try: self.blockout(out, range(0x40, 0xff), range(0xa1, 0xfa), maps.fwd.get) finally: out.close() return maps.rev.items()