Sha256: f47321755cd0bd78098380bd8ec89514271548f02e4d68d0dec57c0842f36aca

Contents?: true

Size: 354 Bytes

Versions: 59

Compression:

Stored size: 354 Bytes

Contents

require 'recog'

module Dap
module Filter

class FilterRecog
  include Base

  def process(doc)
    self.opts.each_pair do |k,v|
      next unless doc.has_key?(k)
      match = Recog::Nizer.match(v, doc[k])
      next unless match
      match.each_pair do |ok, ov|
        doc["#{k}.recog.#{ok}"] = ov.to_s
      end
    end
   [ doc ]
  end
end

end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
dap-1.3.1 lib/dap/filter/recog.rb
dap-1.3.0 lib/dap/filter/recog.rb
dap-1.2.9 lib/dap/filter/recog.rb
dap-1.2.8 lib/dap/filter/recog.rb
dap-1.2.7 lib/dap/filter/recog.rb
dap-1.2.6 lib/dap/filter/recog.rb
dap-1.2.5 lib/dap/filter/recog.rb
dap-1.2.4 lib/dap/filter/recog.rb
dap-1.2.3 lib/dap/filter/recog.rb
dap-1.2.2 lib/dap/filter/recog.rb
dap-1.2.1 lib/dap/filter/recog.rb
dap-1.2.0 lib/dap/filter/recog.rb
dap-1.0.2 lib/dap/filter/recog.rb
dap-1.0.1 lib/dap/filter/recog.rb
dap-1.0.0 lib/dap/filter/recog.rb
dap-0.1.24 lib/dap/filter/recog.rb
dap-0.1.23 lib/dap/filter/recog.rb
dap-0.1.22 lib/dap/filter/recog.rb
dap-0.1.21 lib/dap/filter/recog.rb
dap-0.1.20 lib/dap/filter/recog.rb