Created
June 12, 2023 13:31
-
-
Save AllanChain/9b07b6181e9040b2d23fb8caddc5a247 to your computer and use it in GitHub Desktop.
自然快手辅助码转移
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zrmfast = {} | |
for line in open('./zrmfast.dict.yaml'): | |
if not '\t' in line or not '[' in line: | |
continue | |
char, code, *_ = line.strip().split('\t') | |
zrmfast[char] = code.split('[')[1] | |
lines = [] | |
for line in open('/usr/share/rime-data/luna_pinyin.dict.yaml'): | |
if not '\t' in line: | |
continue | |
char, code, *extra = line.strip().split("\t") | |
aux = zrmfast.get(char) | |
if aux is None: | |
continue | |
line = "\t".join([char, code+";"+aux, *extra]) | |
lines.append(line + '\n') | |
with open ('./lunafast.dict.yaml', 'w') as f: | |
f.writelines(lines) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment