Skip to content

Instantly share code, notes, and snippets.

@tumugin
Created January 24, 2018 18:10
Show Gist options
  • Save tumugin/2510251006f93ad9653d59129f81bf42 to your computer and use it in GitHub Desktop.
Save tumugin/2510251006f93ad9653d59129f81bf42 to your computer and use it in GitHub Desktop.
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
@tumugin
Copy link
Author

tumugin commented Jan 24, 2018

https://twitter.com/imas_db/status/471659860845551616
これをiOSのATOKで使いたかったので変換スクリプトを書いた
ruby atokdic.rb > user_word.txtでどうぞ。

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