Class: Dap::Filter::FilterSplitWord
- Inherits:
-
Object
- Object
- Dap::Filter::FilterSplitWord
- Includes:
- Base
- Defined in:
- lib/dap/filter/simple.rb
Instance Attribute Summary
Attributes included from Base
Instance Method Summary collapse
Methods included from Base
Instance Method Details
#process(doc) ⇒ Object
386 387 388 389 390 391 392 393 394 395 396 |
# File 'lib/dap/filter/simple.rb', line 386 def process(doc) lines = [ ] self.opts.each_pair do |k,v| if doc.has_key?(k) doc[k].to_s.split(/\W/).each do |line| lines << doc.merge({ "#{k}.word" => line }) end end end lines.length == 0 ? [ doc ] : [ lines ] end |