Class: LLT::Review::Treebank::Difference::Generic

Inherits:
Object
  • Object
show all
Includes:
Core::Structures::HashContainable, Helpers::ReviewReporter
Defined in:
lib/llt/review/treebank/difference/generic.rb

Direct Known Subclasses

Attribute, Datapoint, Postag

Instance Attribute Summary collapse

Attributes included from Helpers::ReviewReporter

#unique

Instance Method Summary collapse

Methods included from Helpers::ReviewReporter

#item, #report_diff

Constructor Details

#initialize(item, original, new) ⇒ Generic

Returns a new instance of Generic.



9
10
11
12
13
# File 'lib/llt/review/treebank/difference/generic.rb', line 9

def initialize(item, original, new)
  super(item)
  @original = original
  @new = new
end

Instance Attribute Details

#newObject (readonly)

Returns the value of attribute new.



7
8
9
# File 'lib/llt/review/treebank/difference/generic.rb', line 7

def new
  @new
end

#originalObject (readonly)

Returns the value of attribute original.



7
8
9
# File 'lib/llt/review/treebank/difference/generic.rb', line 7

def original
  @original
end

Instance Method Details

#diff_idObject



23
24
25
# File 'lib/llt/review/treebank/difference/generic.rb', line 23

def diff_id
  @diff_id ||= "#{@id}:#{@original}|#{@new}"
end

#typeObject



27
28
29
# File 'lib/llt/review/treebank/difference/generic.rb', line 27

def type
  @tag
end

#xml_attributesObject



19
20
21
# File 'lib/llt/review/treebank/difference/generic.rb', line 19

def xml_attributes
  { original: @original, new: @new, unique: @unique }
end

#xml_tagObject



15
16
17
# File 'lib/llt/review/treebank/difference/generic.rb', line 15

def xml_tag
  @id
end