Skip to content

Commit

Permalink
unicode_gen: also gen tmp/cjkvar.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
buganini committed Nov 14, 2017
1 parent 4ff7f2b commit e67adee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/unicode_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def bsdconv01(dt):
f_upper=open("modules/inter/UPPER.txt", "w")
f_lower=open("modules/inter/LOWER.txt", "w")
f_casefold=open("modules/inter/CASEFOLD.txt", "w")
f_cjkvar=open("tmp/cjkvar.txt", "w")

ccc_start=-1
ccc_end=-1
Expand Down Expand Up @@ -97,6 +98,7 @@ def in_range(s,rs):
return True
return False

# ftp://ftp.unicode.org/Public/3.0-Update/UnicodeData-3.0.0.html
l_nfd=[]
l_nfkd=[]
ud=open("tmp/UnicodeData.txt")
Expand All @@ -106,6 +108,8 @@ def in_range(s,rs):
a=l.split(";")
cp=bsdconv01(a[0])
code_point=int(a[0], 16)
if "CJK" in a[1] and a[5] and not " "in a[5]:
f_cjkvar.write("{}\t{}\n".format(a[0], a[5]))
if a[3]!="0":
ccc=int(a[3])
if ccc:
Expand Down Expand Up @@ -145,6 +149,7 @@ def in_range(s,rs):
f_ccc.write("{0x%x, 0x%x, %d},\n" % (ccc_start, ccc_end, ccc_value))
f_ccc.write("};\n")
f_ccc.close()
f_cjkvar.close()

sc=open("tmp/SpecialCasing.txt")
for l in sc:
Expand Down

0 comments on commit e67adee

Please sign in to comment.