Created
January 24, 2018 18:10
-
-
Save tumugin/2510251006f93ad9653d59129f81bf42 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
text = File.read("imas_dic.txt") | |
output = "" | |
TAB = "\t" | |
text.split("\n").each do |row| | |
rary = row.split("\t") | |
next if rary.count.zero? | |
wordtype = case rary[2] | |
when '人名' | |
'固有人名' | |
when '固有名詞' | |
'一般名詞' | |
else | |
# any other word types | |
'一般名詞' | |
end | |
output += rary[0] + TAB + rary[1] + TAB + wordtype + "*" + "\n" unless row[0] == "!" | |
end | |
print output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://twitter.com/imas_db/status/471659860845551616
これをiOSのATOKで使いたかったので変換スクリプトを書いた
ruby atokdic.rb > user_word.txt
でどうぞ。