MCPcopy Index your code
hub / github.com/python/cpython / main_hkscs

Function main_hkscs

Tools/unicode/genmap_tchinese.py:208–234  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

206
207
208def main_hkscs():
209 filename = f'python-mappings/hkscs-{HKSCS_VERSION}-big5-iso.txt'
210 with open_mapping_file(filename, MAPPINGS_HKSCS) as f:
211 table = parse_hkscs_map(f)
212 hkscsdecmap, hkscsencmap_bmp, hkscsencmap_nonbmp, isbmpmap = (
213 make_hkscs_map(table)
214 )
215 with open('mappings_hk.h', 'w') as fp:
216 print('Generating BIG5HKSCS decode map...')
217 print_autogen(fp, os.path.basename(__file__))
218 writer = DecodeMapWriter(fp, 'big5hkscs', hkscsdecmap)
219 writer.update_decode_map(BIG5HKSCS_C1, BIG5HKSCS_C2)
220 writer.generate()
221
222 print('Generating BIG5HKSCS decode map Unicode plane hints...')
223 writer = HintsWriter(fp, 'big5hkscs', isbmpmap)
224 writer.fillhints(bh2s(0x8740), bh2s(0xa0fe))
225 writer.fillhints(bh2s(0xc6a1), bh2s(0xc8fe))
226 writer.fillhints(bh2s(0xf9d6), bh2s(0xfefe))
227
228 print('Generating BIG5HKSCS encode map (BMP)...')
229 writer = EncodeMapWriter(fp, 'big5hkscs_bmp', hkscsencmap_bmp)
230 writer.generate()
231
232 print('Generating BIG5HKSCS encode map (non-BMP)...')
233 writer = EncodeMapWriter(fp, 'big5hkscs_nonbmp', hkscsencmap_nonbmp)
234 writer.generate()
235
236
237if __name__ == '__main__':

Callers 1

genmap_tchinese.pyFile · 0.85

Calls 13

generateMethod · 0.95
open_mapping_fileFunction · 0.85
parse_hkscs_mapFunction · 0.85
make_hkscs_mapFunction · 0.85
print_autogenFunction · 0.85
DecodeMapWriterClass · 0.85
HintsWriterClass · 0.85
bh2sFunction · 0.85
EncodeMapWriterClass · 0.85
update_decode_mapMethod · 0.80
fillhintsMethod · 0.80
openFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…