5 header = sys.stdin.readline(), sys.stdin.readline()
11 fields = [x.strip() for x in line.split(';')]
12 u = int(fields[0], 16)
14 if u < 0x0600 or (u > 0x07FF and u != 0x200C and u != 0x200D):
15 raise Exception ("Ooops, unexpected unicode character: ", fields)
19 print " * The following table is generated by running:"
21 print " * ./gen-arabic-joining-table.py < ArabicShaping.txt"
23 print " * on the ArabicShaping.txt file with the header:"
26 print " * %s" % (line.strip())
28 print " /* == Start of generated table == */"
29 for i in range(0x0600, 0x0800):
31 print " JOINING_TYPE_X, /* %04X */" % i
34 if entry[3] in ["ALAPH", "DALATH RISH"]:
35 value = "JOINING_GROUP_" + entry[3].replace(' ', '_')
37 value = "JOINING_TYPE_" + entry[2]
38 print " %s, /* %s */" % (value, '; '.join(entry))
39 print " /* == End of generated table == */"