Class: LLT::Review::Common::Sentence

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

Direct Known Subclasses

Alignment::Sentence, Treebank::Sentence

Instance Method Summary collapse

Instance Method Details

#cloneObject



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

def clone
  cloned = super
  cloned.replace_with_clone(:report)
  cloned
end

#compare(other, comparables = nil) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/llt/review/common/sentence.rb', line 14

def compare(other, comparables = nil)
  diff = new_sentence_diff
  words.each do |id, word|
    other_word = other[id] || dummy_word(id)

    word.compare(other_word, diff, comparables)
  end
  diff
end

#reportObject



10
11
12
# File 'lib/llt/review/common/sentence.rb', line 10

def report
  @report ||= create_report
end

#wordsObject



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

def words
  @container
end