Class: Calais::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/calais/response.rb

Defined Under Namespace

Classes: CalaisHash, Category, Entity, Geography, Instance, Relation

Constant Summary collapse

MATCHERS =
{
  :docinfo => 'DocInfo',
  :docinfometa => 'DocInfoMeta',
  :defaultlangid => 'DefaultLangId',
  :doccat => 'DocCat',
  :entities => 'type/em/e',
  :relations => 'type/em/r',
  :geographies => 'type/er',
  :instances => 'type/sys/InstanceInfo',
  :relevances => 'type/sys/RelevanceInfo',
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rdf_string) ⇒ Response

Returns a new instance of Response.



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/calais/response.rb', line 18

def initialize(rdf_string)
  @raw_response = rdf_string

  @hashes = []
  @entities = []
  @relations = []
  @geographies = []
  @relevances = {} # key = String hash, val = Float relevance
  @categories = []

  extract_data
end

Instance Attribute Details

#categoriesObject

Returns the value of attribute categories.



16
17
18
# File 'lib/calais/response.rb', line 16

def categories
  @categories
end

#doc_dateObject

Returns the value of attribute doc_date.



15
16
17
# File 'lib/calais/response.rb', line 15

def doc_date
  @doc_date
end

#doc_titleObject

Returns the value of attribute doc_title.



15
16
17
# File 'lib/calais/response.rb', line 15

def doc_title
  @doc_title
end

#entitiesObject

Returns the value of attribute entities.



16
17
18
# File 'lib/calais/response.rb', line 16

def entities
  @entities
end

#geographiesObject

Returns the value of attribute geographies.



16
17
18
# File 'lib/calais/response.rb', line 16

def geographies
  @geographies
end

#hashesObject

Returns the value of attribute hashes.



16
17
18
# File 'lib/calais/response.rb', line 16

def hashes
  @hashes
end

#languageObject

Returns the value of attribute language.



15
16
17
# File 'lib/calais/response.rb', line 15

def language
  @language
end

#relationsObject

Returns the value of attribute relations.



16
17
18
# File 'lib/calais/response.rb', line 16

def relations
  @relations
end

#request_idObject

Returns the value of attribute request_id.



15
16
17
# File 'lib/calais/response.rb', line 15

def request_id
  @request_id
end

#signatureObject

Returns the value of attribute signature.



15
16
17
# File 'lib/calais/response.rb', line 15

def signature
  @signature
end

#submission_dateObject

Returns the value of attribute submission_date.



15
16
17
# File 'lib/calais/response.rb', line 15

def submission_date
  @submission_date
end

#submitter_codeObject

Returns the value of attribute submitter_code.



15
16
17
# File 'lib/calais/response.rb', line 15

def submitter_code
  @submitter_code
end