Forums: users (Thread #9866)

mecab-0.90 対応 (2006-01-12 09:54 by (del#17342) #19021)

mecab-0.90 からバインディングのインターフェースが変更になりました。とりあえず以下の修正で動作するようです。

mecab-0.81 以前と互換を保つのが難しいと思いますが、ご検討願います。

--- bsfilter/bsfilter Mon Nov 14 23:52:36 2005
+++ /usr/local/bin/bsfilter Thu Jan 12 09:42:45 2006
@@ -1022,7 +1022,7 @@
@method = Proc::new {|s| block(s)}
when "mecab"
@method = Proc::new {|s| mecab(s)}
- @m = MeCab::Tagger.new([$0, "-Ochasen"])
+ @m = MeCab::Tagger.new("-Ochasen")
when "chasen"
Chasen.getopt("-F", '%H %m\n', "-j")
@method = Proc::new {|s| chasen(s)}
@@ -1064,7 +1064,7 @@
end
array = Array::new
node = @m.parseToNode(str)
- while (node.hasNode == 1)
+ while (node.stat == 1)
token = node.getSurface
hinshi = node.getFeature.split(/,/)[0]
## print token, hinshi, "\n"

Reply to #19021×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mecab-0.90 対応 (2006-01-14 15:23 by nabeken #19090)

ありがとうございます。
http://lists.sourceforge.jp/mailman/archives/mecab-devel/2006-January/000010.html
mecabのバージョンを知ることは可能になりそうなので、対応を検討します。
Reply to #19021

Reply to #19090×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login