Class: Dap::Filter::FilterFieldSplitWord
- Inherits:
-
Object
- Object
- Dap::Filter::FilterFieldSplitWord
- 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
390 391 392 393 394 395 396 397 398 399 400 401 |
# File 'lib/dap/filter/simple.rb', line 390 def process(doc) self.opts.each_pair do |k,v| if doc.has_key?(k) wcount = 1 doc[k].to_s.split(/\W/).each do |word| doc.merge!({ "#{k}.f#{wcount}" => word }) wcount += 1 end end end [ doc ] end |