Last active
November 28, 2018 08:23
-
-
Save utgwkk/cf099c99bff35d307e0d9a212d90b11b to your computer and use it in GitHub Desktop.
http://9lab.jp/works/dic/th-dic.php の Google 日本語入力向けの東方Project IME辞書をSKK用の辞書に変換するスクリプト
This file contains 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
#!/usr/bin/python | |
# coding: utf-8 | |
# http://9lab.jp/works/dic/th-dic.php の Google 日本語入力向けの東方Project IME辞書を | |
# SKK用の辞書に変換するスクリプト | |
# Usage: | |
# python thdic2skk.py < thdic-r6-0-総合.txt > SKK-JISYO.touhou.utf8 | |
from __future__ import print_function | |
import sys | |
def main(argv): | |
print(';; okuri-nasi entries.') | |
for line in sys.stdin: | |
splitted = line.rstrip().split('\t') | |
if len(splitted) == 4: | |
yomi, henkan, _, comment = splitted | |
else: | |
yomi, henkan, comment = splitted | |
comment = comment.replace('/', '|') | |
print('{} /{};{}/'.format(yomi, henkan, comment)) | |
if __name__ == '__main__': | |
sys.exit(main(sys.argv)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://coexe.web.fc2.com/thdic-r6.js
Abbrevモード用のエントリを補完する前処理を作りました