Class: LLT::Review::Common::Reviewable

Inherits:
Object
  • Object
show all
Includes:
Core::Structures::HashContainable
Defined in:
lib/llt/review/common/reviewable.rb

Direct Known Subclasses

Alignment::Reviewable, Treebank::Reviewable

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, sentences) ⇒ Reviewable



8
9
10
11
# File 'lib/llt/review/common/reviewable.rb', line 8

def initialize(id, sentences)
  super(id)
  @sentences = sentences
end

Instance Attribute Details

#sentencesObject (readonly)

Returns the value of attribute sentences.



6
7
8
# File 'lib/llt/review/common/reviewable.rb', line 6

def sentences
  @sentences
end

Instance Method Details

#compare(gold, comparables = nil) ⇒ Object



23
24
25
26
27
# File 'lib/llt/review/common/reviewable.rb', line 23

def compare(gold, comparables = nil)
  comparison = Comparison.new(gold, self)
  comparison.compare(comparables)
  add(comparison) if comparison.any?
end

#diffObject



19
20
21
# File 'lib/llt/review/common/reviewable.rb', line 19

def diff
  @container
end

#to_xmlObject



29
30
31
# File 'lib/llt/review/common/reviewable.rb', line 29

def to_xml
  container_to_xml
end

#xml_tagObject

can’t use the class methods that set the same, as we have subclasses using this value as well



15
16
17
# File 'lib/llt/review/common/reviewable.rb', line 15

def xml_tag
  :reviewable
end