module ToNouns

Constants

VERSION

Public Instance Methods

to_nouns(general: false) click to toggle source
# File lib/to_nouns.rb, line 8
def to_nouns(general: false)
  append = general ? ',一般' : nil
  nouns  = []

  Natto::MeCab.new.parse(to_s) do |n|
    next unless n.feature =~ /名詞#{append}/
    nouns << n.surface
  end

  nouns
end