提交 f2ad86e6 编写于 作者: B Behdad Esfahbod

[indic-table-gen] Minor

上级 2ec62279
...@@ -87,14 +87,14 @@ short = [{ ...@@ -87,14 +87,14 @@ short = [{
},{ },{
"Not_Applicable": 'x', "Not_Applicable": 'x',
}] }]
all_shorts = [[],[]] all_shorts = [{},{}]
# Add some of the values, to make them more readable, and to avoid duplicates # Add some of the values, to make them more readable, and to avoid duplicates
for i in range (2): for i in range (2):
for v,s in short[i].items (): for v,s in short[i].items ():
all_shorts[i].append (s) all_shorts[i][s] = v
what = ["INDIC_SYLLABIC_CATEGORY", "INDIC_MATRA_CATEGORY"] what = ["INDIC_SYLLABIC_CATEGORY", "INDIC_MATRA_CATEGORY"]
what_short = ["ISC", "IMC"] what_short = ["ISC", "IMC"]
...@@ -109,8 +109,8 @@ for i in range (2): ...@@ -109,8 +109,8 @@ for i in range (2):
else: else:
s = ''.join ([c for c in v_no_and if ord ('A') <= ord (c) <= ord ('Z')]) s = ''.join ([c for c in v_no_and if ord ('A') <= ord (c) <= ord ('Z')])
if s in all_shorts[i]: if s in all_shorts[i]:
raise Exception ("Duplicate short value alias", v, s) raise Exception ("Duplicate short value alias", v, all_shorts[i][s])
all_shorts[i].append (s) all_shorts[i][s] = v
short[i][v] = s short[i][v] = s
print "#define %s_%s %s_%s %s/* %3d chars; %s */" % \ print "#define %s_%s %s_%s %s/* %3d chars; %s */" % \
(what_short[i], s, what[i], v.upper (), \ (what_short[i], s, what[i], v.upper (), \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册