我安装了这个 gem - https://github.com/pluskid/rmmseg-cpp。
(文档:http ://rmmseg-cpp.rubyforge.org/ )
当我尝试运行此示例命令时:$echo "我们都喜欢用 Ruby" | rmmseg
我得到:
/Users/webmagnets/.rvm/gems/ruby-1.9.3-p327@blt/gems/rmmseg-0.1.6/lib/rmmseg/algorithm.rb:24:in `next_token': undefined method `length' for #<Enumerator: "我们都喜欢用 Ruby\n":each_char> (NoMethodError)
from /Users/webmagnets/.rvm/gems/ruby-1.9.3-p327@blt/gems/rmmseg-0.1.6/lib/rmmseg/algorithm.rb:44:in `segment'
from /Users/webmagnets/.rvm/gems/ruby-1.9.3-p327@blt/gems/rmmseg-0.1.6/lib/rmmseg.rb:12:in `segment'
from /Users/webmagnets/.rvm/gems/ruby-1.9.3-p327@blt/gems/rmmseg-0.1.6/bin/rmmseg:65:in `<top (required)>'
from /Users/webmagnets/.rvm/gems/ruby-1.9.3-p327@blt/bin/rmmseg:23:in `load'
from /Users/webmagnets/.rvm/gems/ruby-1.9.3-p327@blt/bin/rmmseg:23:in `<main>'