Class: Retreval::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/retreval/gold_standard.rb

Overview

A Query is effectively a string that is used as its ID.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Query) initialize(args)

Creates a new Query object with a specified string



342
343
344
345
# File 'lib/retreval/gold_standard.rb', line 342

def initialize(args)
  @querystring = args[:querystring].to_s
  raise "Can not construct a Query with an empty query string" if @querystring.nil?
end

Instance Attribute Details

- (Object) querystring (readonly)

Returns the value of attribute querystring



334
335
336
# File 'lib/retreval/gold_standard.rb', line 334

def querystring
  @querystring
end

Instance Method Details

- (Object) ==(query)

Compares two Query objects according to their query string



337
338
339
# File 'lib/retreval/gold_standard.rb', line 337

def ==(query)
  query.querystring == self.querystring
end