Last active
July 10, 2016 01:12
-
-
Save kamatari/7b31e13e6d7b1280776df5030f9de277 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'natto' | |
text = 'すもももももももものうち' | |
natto = Natto::MeCab.new | |
natto.parse(text) do |n| | |
if n.feature.split(',')[0] == '名詞' | |
puts "#{n.surface}\t#{n.feature}" | |
end | |
end | |
==== | |
すもも 名詞,一般,*,*,*,*,すもも,スモモ,スモモ | |
もも 名詞,一般,*,*,*,*,もも,モモ,モモ | |
もも 名詞,一般,*,*,*,*,もも,モモ,モモ | |
うち 名詞,非自立,副詞可能,*,*,*,うち,ウチ,ウチ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment