Skip to content

Commit

Permalink
build: test v2
Browse files Browse the repository at this point in the history
  • Loading branch information
mirtlecn committed Jun 4, 2024
1 parent 0110e3a commit 8a7e220
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dict
Submodule dict updated 1 files
+20,252 −0 部分缺字补充.txt
10 changes: 7 additions & 3 deletions gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
radical = []
yaml = set()
comment = set()
error = set()
pattern = re.compile("^[a-z']+$")
kmandarin_8105.load()
custom_dict = {
Expand Down Expand Up @@ -134,15 +135,18 @@ def is_not_empty(s):
for pinyin in product(*pinyin_list):
PINYIN = "'".join(filter(is_not_empty, pinyin))
if not pattern.match(PINYIN):
print('\033[91m' + line + ' >> ' + PINYIN + '\033[0m')
raise ValueError("error!")
# continue
error_line = line + ' >> ' + PINYIN
error.add(error_line)
continue
item = f"{char.strip()}\t{PINYIN}"
yaml.add(item)

with open("info.yaml", 'r', encoding='utf-8') as f:
extra_content = f.read()

with open("gen/error.yaml", 'w', encoding='utf-8') as f:
f.write("\n".join(error))

with open("add.yaml", 'r', encoding='utf-8') as f:
add = f.read()

Expand Down

0 comments on commit 8a7e220

Please sign in to comment.