Tag: Mecab
brew install mecab mecab-ipadic
require 'natto' text = <<"EOS" 悪質な業者によるトラブルが全国で急増している。 EOS nm = Natto::MeCab.new nm.parse(text) do |n| puts "#{n.surface}\t#{n.feature}" end
$CFLAGS += ' ' + `#{mecab_config} --cflags`.chomp $LDFLAGS = '-L/usr/local/lib' have_header('mecab.h') && create_makefile('MeCab')