Create a gist now

Instantly share code, notes, and snippets.

@utgwkk /thdic2skk.py
Last active Feb 19, 2017

What would you like to do?
http://9lab.jp/works/dic/th-dic.php の Google 日本語入力向けの東方Project IME辞書をSKK用の辞書に変換するスクリプト
#!/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))
@coexe
coexe commented Feb 19, 2017

http://coexe.web.fc2.com/thdic-r6.js
Abbrevモード用のエントリを補完する前処理を作りました

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment