Class: Calais::Response
- Inherits:
-
Object
- Object
- Calais::Response
- Defined in:
- lib/calais/response.rb
Defined Under Namespace
Classes: CalaisHash, Category, Entity, Geography, Instance, Relation, SocialTag
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', :socialtags => 'SocialTag' }
Instance Attribute Summary collapse
-
#categories ⇒ Object
Returns the value of attribute categories.
-
#doc_date ⇒ Object
Returns the value of attribute doc_date.
-
#doc_title ⇒ Object
Returns the value of attribute doc_title.
-
#entities ⇒ Object
Returns the value of attribute entities.
-
#geographies ⇒ Object
Returns the value of attribute geographies.
-
#hashes ⇒ Object
Returns the value of attribute hashes.
-
#language ⇒ Object
Returns the value of attribute language.
-
#relations ⇒ Object
Returns the value of attribute relations.
-
#request_id ⇒ Object
Returns the value of attribute request_id.
-
#signature ⇒ Object
Returns the value of attribute signature.
-
#social_tags ⇒ Object
Returns the value of attribute social_tags.
-
#submission_date ⇒ Object
Returns the value of attribute submission_date.
-
#submitter_code ⇒ Object
Returns the value of attribute submitter_code.
Instance Method Summary collapse
-
#initialize(rdf_string) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(rdf_string) ⇒ Response
Returns a new instance of Response.
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/calais/response.rb', line 19 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
#categories ⇒ Object
Returns the value of attribute categories.
17 18 19 |
# File 'lib/calais/response.rb', line 17 def categories @categories end |
#doc_date ⇒ Object
Returns the value of attribute doc_date.
16 17 18 |
# File 'lib/calais/response.rb', line 16 def doc_date @doc_date end |
#doc_title ⇒ Object
Returns the value of attribute doc_title.
16 17 18 |
# File 'lib/calais/response.rb', line 16 def doc_title @doc_title end |
#entities ⇒ Object
Returns the value of attribute entities.
17 18 19 |
# File 'lib/calais/response.rb', line 17 def entities @entities end |
#geographies ⇒ Object
Returns the value of attribute geographies.
17 18 19 |
# File 'lib/calais/response.rb', line 17 def geographies @geographies end |
#hashes ⇒ Object
Returns the value of attribute hashes.
17 18 19 |
# File 'lib/calais/response.rb', line 17 def hashes @hashes end |
#language ⇒ Object
Returns the value of attribute language.
16 17 18 |
# File 'lib/calais/response.rb', line 16 def language @language end |
#relations ⇒ Object
Returns the value of attribute relations.
17 18 19 |
# File 'lib/calais/response.rb', line 17 def relations @relations end |
#request_id ⇒ Object
Returns the value of attribute request_id.
16 17 18 |
# File 'lib/calais/response.rb', line 16 def request_id @request_id end |
#signature ⇒ Object
Returns the value of attribute signature.
16 17 18 |
# File 'lib/calais/response.rb', line 16 def signature @signature end |
#social_tags ⇒ Object
Returns the value of attribute social_tags.
17 18 19 |
# File 'lib/calais/response.rb', line 17 def @social_tags end |
#submission_date ⇒ Object
Returns the value of attribute submission_date.
16 17 18 |
# File 'lib/calais/response.rb', line 16 def submission_date @submission_date end |
#submitter_code ⇒ Object
Returns the value of attribute submitter_code.
16 17 18 |
# File 'lib/calais/response.rb', line 16 def submitter_code @submitter_code end |