MeCab ã® Ruby å種ã©ã¤ãã©ãªããã³ãåã£ã¦ã¿ã
åæ¸ã
ãã£ããï¼@takkkunï¼ã¨ã®ä¼è©±
ãMeCab ã® Ruby BindingãSWIG 使ã£ã¦ããã MeCab ã¨å¯çµåãã¦ã¦ãæå
ã¨ãµã¼ã㧠MeCab ã®ãã¼ã¸ã§ã³ãéãæã«ã¤ã³ã¹ãã¼ã«ããã®é¢åèããã ããã
ãNatto gem 使ãã°è¯ããããã
ãNatto gem é
ããã ãã
åææ¡ä»¶
MeCab ã®ãã¼ã¸ã§ã³ã¯ 0.996 ã使ç¨
ãã³ããã¼ã¯ã¯ parse ã¡ã½ããï¼mecab_parse_tostr é¢æ°ï¼ã®ã¿ã対象ã¨ãã
ä½æ Natto gem ãé ãã®ã調ã¹ã
Natto::MeCab#parse ã¡ã½ããå
ã§ãåæåæã«ä½æãããç¡åé¢æ°ãå¼ãã§ããã¨ããããã¯ããã£ãå ´åã®å¦çã®åãåãããã¦ããã¨ããã«ãã¼çµç±ã§ã¨ã³ã³ã¼ãã£ã³ã°ãã¦ããã¨ãããã«ããã¯ã«ãªã£ã¦ãããã¨ãåãã£ã
ããã®æ¡ä»¶åå²ããã«ãã¼ã¡ã½ããã®å¼ã³åºãããªãããã¼ãã³ã¼ããã¦ã¿ã㨠MeCab å
¬å¼ã® Ruby Binding ã¨é度ããã¾ãå¤ãããªããã¨ãåãã£ã
ãã³ããã¼ã¯çµæ
以ä¸ã¯ãã³ããã¼ã¯ã«ä½¿ã£ãã³ã¼ã
ffi ã使ã£ã¦ç°¡æçã«ä½ã£ããã¼ã¸ã§ã³ãè¼ãã¦ã
ãã³ããã¼ã¯çµæ
Rehearsal ---------------------------------------------- åå¸èª 0.090000 0.000000 0.090000 ( 0.100041) ç´è± 0.130000 0.000000 0.130000 ( 0.127894) 大è±ç´è± 0.090000 0.000000 0.090000 ( 0.093463) ãã®ãã 0.100000 0.010000 0.110000 ( 0.101709) ------------------------------------- total: 0.420000sec user system total real åå¸èª 0.090000 0.000000 0.090000 ( 0.090971) ç´è± 0.120000 0.000000 0.120000 ( 0.124085) 大è±ç´è± 0.090000 0.000000 0.090000 ( 0.090563) ãã®ãã 0.100000 0.000000 0.100000 ( 0.094437)
å ã® Natto gem 以å¤ã¯ã»ã¨ãã©é度ãå¤ãããªããã¨ãåãã£ã
追è¨
Twitter ã§ææé ãã¾ãã
ããã¯è¯ããã³ããã¡ãªã¿ã«åãæå
ã§ãã³ãåã£ããã©ã解æããæååã®é·ãã§ãé度ã«å·®ãåºã¦ã / MeCab ã® Ruby å種ã©ã¤ãã©ãªããã³ãåã£ã¦ã¿ã - life.stub(:happy?).and_return(true) http://t.co/Ljgjrhj3I4
— ãã£ãã (@takkkun) April 21, 2013
å
·ä½çã«ã¯è§£æããæååãçãã»ã©mecab-rubyããé·ãã»ã©ffiãéãã£ã¦çµæã ã£ããçµå±ãçãã¨ãå¦çæéããããªã¼ããããã®æ¯çã大ãããªãããªã¼ããããçã«åªä½ãªCæ¡å¼µã®æ¹ãéãã£ã¦ã®ã¯åãããã©ãé·ãã¨ffiã®æ¹ãéãã£ã¦ã®ã¯çç±ãåããããã£ã
— ãã£ãã (@takkkun) April 21, 2013
é¢é£ãªã³ã¯
MeCab: Yet Another Part-of-Speech and Morphological Analyzer