Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@utgwkk
Last active November 28, 2018 08:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save utgwkk/cf099c99bff35d307e0d9a212d90b11b to your computer and use it in GitHub Desktop.
Save utgwkk/cf099c99bff35d307e0d9a212d90b11b to your computer and use it in GitHub Desktop.
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
Copy link

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