Class: TextRazor::Entailment

Inherits:
Object
  • Object
show all
Extended by:
Util
Defined in:
lib/textrazor/entailment.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Util

standardize

Constructor Details

#initialize(params = {}) ⇒ Entailment

Returns a new instance of Entailment.



10
11
12
13
14
15
# File 'lib/textrazor/entailment.rb', line 10

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

#context_scoreObject (readonly)

Returns the value of attribute context_score.



7
8
9
# File 'lib/textrazor/entailment.rb', line 7

def context_score
  @context_score
end

#entailed_treeObject (readonly)

Returns the value of attribute entailed_tree.



7
8
9
# File 'lib/textrazor/entailment.rb', line 7

def entailed_tree
  @entailed_tree
end

#entailed_wordsObject (readonly)

Returns the value of attribute entailed_words.



7
8
9
# File 'lib/textrazor/entailment.rb', line 7

def entailed_words
  @entailed_words
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/textrazor/entailment.rb', line 7

def id
  @id
end

#prior_scoreObject (readonly)

Returns the value of attribute prior_score.



7
8
9
# File 'lib/textrazor/entailment.rb', line 7

def prior_score
  @prior_score
end

#scoreObject (readonly)

Returns the value of attribute score.



7
8
9
# File 'lib/textrazor/entailment.rb', line 7

def score
  @score
end

#word_positionsObject (readonly)

Returns the value of attribute word_positions.



7
8
9
# File 'lib/textrazor/entailment.rb', line 7

def word_positions
  @word_positions
end

Class Method Details

.create_from_hash(params) ⇒ Object



17
18
19
20
# File 'lib/textrazor/entailment.rb', line 17

def self.create_from_hash(params)
  params = Hash[params.map {|k, v| [standardize(k), v] }]
  new(params)
end