Class: Fluent::MeCabOutput

Inherits:
Output
  • Object
show all
Defined in:
lib/fluent/plugin/out_mecab.rb

Instance Method Summary collapse

Constructor Details

#initializeMeCabOutput

Returns a new instance of MeCabOutput.



9
10
11
12
# File 'lib/fluent/plugin/out_mecab.rb', line 9

def initialize
  super
  require 'fluent/plugin/mecab'
end

Instance Method Details

#configure(config) ⇒ Object



14
15
16
17
# File 'lib/fluent/plugin/out_mecab.rb', line 14

def configure(config)
  super
  @mecab = MeCab.new(@parse_type, @key.split(',').map{|string| string.strip})
end

#emit(tag, es, chain) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/fluent/plugin/out_mecab.rb', line 27

def emit(tag, es, chain)
  es.each do |time, record|
    parse(record).each do |mecab|
      Engine.emit(@tag, time, mecab)
    end
  end
end

#parse(record) ⇒ Object



35
36
37
# File 'lib/fluent/plugin/out_mecab.rb', line 35

def parse(record)
  @mecab.parse(record)
end

#shutdownObject



23
24
25
# File 'lib/fluent/plugin/out_mecab.rb', line 23

def shutdown
  super
end

#startObject



19
20
21
# File 'lib/fluent/plugin/out_mecab.rb', line 19

def start
  super
end