ATOK 㧠ruby ã®å®è¡çµæãè¿ããã©ã°ã¤ã³
ATOK ãã¤ã¬ã¯ã API ãå ¬éãããRuby/Perl 㧠ATOK ãã©ã°ã¤ã³ãä½ããããã«ãªã£ãã®ã§ãæ©éç°¡åãã¤ä½ã§ãã§ãããã©ã°ã¤ã³ãä½ã£ã¦ã¿ã¾ããã
ã»ããã¢ããããATOKãã¤ã¬ã¯ãAPIãã¤ãããRuby ã®å®è¡ç°å¢ãããã¨ãATOK ã§å ¥åä¸ã« Ctrl + Insert 㧠Ruby ã®å®è¡çµæãå¤æããã¦è¿ã£ã¦ãã¾ãããã¨ãã°é»åã£ã½ãããããããã¨ãã«ã¯
24*24
ã¨å ¥åããã¨ãã« Ctrl+Insert ãæã¤ã¨
576
ãªæååãè¿ã£ã¦ããã®ã§ãé»åã¨ãã¦ã¤ããã¦ä¾¿å©ï¼
ã¾ã
'korehabenri'.split(//).join(' ')
ãCtrl+Insert ã§å¤æããã¨
k o r e h a b e n r i
ã¨ãªãã¹ãã¼ãã«ã¹ãã¼ã¹ãå ¥ãããã¾ãã!!!
ã¾ããnotepad.exe ã®ãããªåå¤æå¯è½ãªã¢ããªã±ã¼ã·ã§ã³ã§ã¯ãã¾ã ruby ã®å®è¡ã§ãã syntax ãæ¸ãã¦ãããç¯å²é¸æâåå¤æâCtrl+Insert ã§å®è¡ãªã©ãå¯è½ãªããã§ãã
ãã©ã°ã¤ã³ã®å®è£ ã¯ãã£ã¡ãããããã«ã§ããã®ã§ãã¿ãªãããããããä½ã£ã¦ã¿ã¦ã¯ãããã§ãããããã¡ãªã¿ã« ruby_eval ã®ãã©ã°ã¤ã³ã®å®ã³ã¼ãã¯
#!/usr/bin/ruby $KCODE = 'u' require 'timeout' module Atok_plugin def run_process( a_request_data ) res = nil timeout(3) do res = eval a_request_data['composition_string'] end {'candidate' => [{'hyoki' => res.to_s, 'comment' => res.to_s}]} rescue Exception => e {'candidate' => [{'hyoki' => 'ã¨ã©ã¼ãçºçãã¾ãã', 'comment' => e.to_s }]} end end
ã ãã§ãã