예제 #1
0
def main():
    print _header
    ugroups = []
    for name, codes in unicode.Categories().iteritems():
        ugroups.append(PrintGroup(name, codes))
    for name, codes in unicode.Scripts().iteritems():
        ugroups.append(PrintGroup(name, codes))
    print "// %d 16-bit ranges, %d 32-bit ranges" % (n16, n32)
    print "UGroup unicode_groups[] = {"
    ugroups.sort()
    for ug in ugroups:
        print "\t%s," % (ug, )
    print "};"
    print "int num_unicode_groups = %d;" % (len(ugroups), )
    print _trailer
예제 #2
0
def main():
    categories = unicode.Categories()
    scripts = unicode.Scripts()
    print(_header)
    ugroups = []
    for name in sorted(categories):
        ugroups.append(PrintGroup(name, categories[name]))
    for name in sorted(scripts):
        ugroups.append(PrintGroup(name, scripts[name]))
    print("// %d 16-bit ranges, %d 32-bit ranges" % (n16, n32))
    print("const UGroup unicode_groups[] = {")
    ugroups.sort()
    for ug in ugroups:
        print("\t%s," % (ug, ))
    print("};")
    print("const int num_unicode_groups = %d;" % (len(ugroups), ))
    print(_trailer)