Last active
August 29, 2015 14:06
-
-
Save doraTeX/e5f7b438afacbc3c5edf to your computer and use it in GitHub Desktop.
iOS標準キーボードの登録単語をMac経由でATOK for iOSへインポートする ref: http://qiita.com/doraTeX/items/3d2bfd2622286c0aca72
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/ruby | |
require 'rexml/document' | |
dict = REXML::Document.new(open("ユーザ辞書.plist")) | |
open("user_word.txt","w:UTF-16LE"){|f| | |
f.print "\uFEFF!!ATOK_TANGO_TEXT_HEADER_1\r\n\r\n" | |
dict.elements.each('plist/array/dict') do |element| | |
phrase = element.elements[2].text | |
shortcut = element.elements[4].text | |
f.print sprintf("%s\t%s\t名詞*\r\n", shortcut, phrase).encode(Encoding::UTF_16) | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment