examples/ruby-percolator/ruby-percolator.rb
# returns the actual output of lmgrep
returns the actual output of lmgrep
returns the actual output of lmgrep
def match(text)
    @stdin.puts text
    output = Timeout::timeout(@timeout) {
      @stdout.gets
    }
    return nil if output.strip.empty?
    JSON.parse(output)
  rescue Timeout::Error
    puts "Percolation failed on '#{text}'"
    raise "Percolation timed-out!!!"
  end
def match ( text ) @stdin . puts text output = Timeout :: timeout ( @timeout ) { @stdout . gets } return nil if output . strip . empty? JSON . parse ( output ) rescue Timeout :: Error puts "Percolation failed on '#{text}'" raise "Percolation timed-out!!!" end
returns the actual output of lmgrep
returns the actual output of lmgrep
text