Class: TextRazor::Entity
- Inherits:
-
Object
- Object
- TextRazor::Entity
- Extended by:
- Util
- Defined in:
- lib/textrazor/entity.rb
Instance Attribute Summary collapse
-
#confidence_score ⇒ Object
readonly
Returns the value of attribute confidence_score.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#ending_pos ⇒ Object
readonly
Returns the value of attribute ending_pos.
-
#entity_english_id ⇒ Object
readonly
Returns the value of attribute entity_english_id.
-
#entity_id ⇒ Object
readonly
Returns the value of attribute entity_id.
-
#freebase_id ⇒ Object
readonly
Returns the value of attribute freebase_id.
-
#freebase_types ⇒ Object
readonly
Returns the value of attribute freebase_types.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#matched_text ⇒ Object
readonly
Returns the value of attribute matched_text.
-
#matching_tokens ⇒ Object
readonly
Returns the value of attribute matching_tokens.
-
#relevance_score ⇒ Object
readonly
Returns the value of attribute relevance_score.
-
#starting_pos ⇒ Object
readonly
Returns the value of attribute starting_pos.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#wiki_link ⇒ Object
readonly
Returns the value of attribute wiki_link.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Entity
constructor
A new instance of Entity.
Methods included from Util
Constructor Details
#initialize(params = {}) ⇒ Entity
Returns a new instance of Entity.
11 12 13 14 15 16 |
# File 'lib/textrazor/entity.rb', line 11 def initialize(params = {}) @type = [] params.each do |k, v| instance_variable_set(:"@#{k}", v) if v && self.respond_to?(:"#{k}") end end |
Instance Attribute Details
#confidence_score ⇒ Object (readonly)
Returns the value of attribute confidence_score.
7 8 9 |
# File 'lib/textrazor/entity.rb', line 7 def confidence_score @confidence_score end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/textrazor/entity.rb', line 7 def data @data end |
#ending_pos ⇒ Object (readonly)
Returns the value of attribute ending_pos.
7 8 9 |
# File 'lib/textrazor/entity.rb', line 7 def ending_pos @ending_pos end |
#entity_english_id ⇒ Object (readonly)
Returns the value of attribute entity_english_id.
7 8 9 |
# File 'lib/textrazor/entity.rb', line 7 def entity_english_id @entity_english_id end |
#entity_id ⇒ Object (readonly)
Returns the value of attribute entity_id.
7 8 9 |
# File 'lib/textrazor/entity.rb', line 7 def entity_id @entity_id end |
#freebase_id ⇒ Object (readonly)
Returns the value of attribute freebase_id.
7 8 9 |
# File 'lib/textrazor/entity.rb', line 7 def freebase_id @freebase_id end |
#freebase_types ⇒ Object (readonly)
Returns the value of attribute freebase_types.
7 8 9 |
# File 'lib/textrazor/entity.rb', line 7 def freebase_types @freebase_types end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/textrazor/entity.rb', line 7 def id @id end |
#matched_text ⇒ Object (readonly)
Returns the value of attribute matched_text.
7 8 9 |
# File 'lib/textrazor/entity.rb', line 7 def matched_text @matched_text end |
#matching_tokens ⇒ Object (readonly)
Returns the value of attribute matching_tokens.
7 8 9 |
# File 'lib/textrazor/entity.rb', line 7 def matching_tokens @matching_tokens end |
#relevance_score ⇒ Object (readonly)
Returns the value of attribute relevance_score.
7 8 9 |
# File 'lib/textrazor/entity.rb', line 7 def relevance_score @relevance_score end |
#starting_pos ⇒ Object (readonly)
Returns the value of attribute starting_pos.
7 8 9 |
# File 'lib/textrazor/entity.rb', line 7 def starting_pos @starting_pos end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/textrazor/entity.rb', line 7 def type @type end |
#wiki_link ⇒ Object (readonly)
Returns the value of attribute wiki_link.
7 8 9 |
# File 'lib/textrazor/entity.rb', line 7 def wiki_link @wiki_link end |
Class Method Details
.create_from_hash(params) ⇒ Object
18 19 20 21 |
# File 'lib/textrazor/entity.rb', line 18 def self.create_from_hash(params) params = Hash[params.map {|k, v| [standardize(k), v] }] new(params) end |