File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515# - cache/convert_table_words_twp.txt
1616# - cache/convert_table_chars_twp.txt
1717
18+ from itertools import chain
1819from opencc import OpenCC
1920
2021def build_entries (twp = False ):
21- with open ('opencc_data/STCharacters.txt' ) as f : # s2t
22- for line in f :
23- k , vx = line .rstrip ('\n ' ).split ('\t ' )
24- v = vx .split (' ' )[0 ] # Only select the first candidate
25- v = t2twp (v ) if twp else v # s2t -> s2twp
26- yield k , v
27-
28- with open ('opencc_data/STPhrases.txt' ) as f : # s2t
29- for line in f :
22+ with open ('opencc_data/STCharacters.txt' ) as f1 , \
23+ open ('opencc_data/STPhrases.txt' ) as f2 , \
24+ open ('build/extra_convert_table.txt' ) as f3 : # s2t
25+ for line in chain (f1 , f2 , f3 ):
3026 k , vx = line .rstrip ('\n ' ).split ('\t ' )
3127 v = vx .split (' ' )[0 ] # Only select the first candidate
3228 v = t2twp (v ) if twp else v # s2t -> s2twp
Original file line number Diff line number Diff line change 1+ “ 「
2+ ” 」
3+ ‘ 『
4+ ’ 』
Original file line number Diff line number Diff line change 66import os
77import subprocess
88
9- FONT_VERSION = 1.005
9+ FONT_VERSION = 1.006
1010
1111# Define the max entries size in a subtable.
1212# We define a number that is small enough here, so that the entries will not exceed
@@ -194,7 +194,7 @@ def remove_glyph(obj, glyph_name):
194194 # Remove glyph from glyph_order table
195195 try :
196196 obj ['glyph_order' ].remove (glyph_name )
197- except ValueError as e :
197+ except ValueError :
198198 pass
199199
200200 # Remove glyph from glyf table
Original file line number Diff line number Diff line change 3939 "encodingID" : 1 ,
4040 "languageID" : 1033 ,
4141 "nameID" : 0 ,
42- "nameString" : " Copyright © 2020 Ayaka Mikazuki."
42+ "nameString" : " Copyright © 2020-2021 Ayaka Mikazuki."
4343 },
4444 {
4545 "platformID" : 3 ,
Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ <h2>测试台湾字词转换</h2>
4949 < p class ="tw "> 我们在老挝的服务器的硬盘需要使用互联网算法软件解决异步的问题</ p >
5050 < p > 为什么你在床里面睡着?</ p >
5151 < p class ="tw "> 为什么你在床里面睡着?</ p >
52+ < p > 他站起来问:“老师,‘有条不紊’的‘紊’是什么意思?”</ p >
53+ < p class ="tw "> 他站起来问:“老师,‘有条不紊’的‘紊’是什么意思?”</ p >
5254 < p > 台式机</ p >
5355 < p class ="tw "> 台式机</ p >
5456 < p > 着装污染虚伪发泄棱柱群众里面</ p >
You can’t perform that action at this time.
0 commit comments