class LLT::Review::Treebank::Difference::Postag

Constants

POSTAG_SCHEMA

copied over right now from Postag until we figure out how to solve this more globally

Public Class Methods

new(tag, original, new) click to toggle source
# File lib/llt/review/treebank/difference/postag.rb, line 4
def initialize(tag, original, new)
  super
  compute_detailed_differences
end

Public Instance Methods

diff_id() click to toggle source
# File lib/llt/review/treebank/difference/postag.rb, line 9
def diff_id
  @diff_id ||= "#{id}:#{map { |_, v| v.diff_id }.join('::')}"
end

Private Instance Methods

compute_detailed_differences() click to toggle source
# File lib/llt/review/treebank/difference/postag.rb, line 23
def compute_detailed_differences
  @original.each_char.with_index do |a, i|
    b = @new[i]
    add(Datapoint.new(POSTAG_SCHEMA[i], a, b)) unless a == b
  end
end
write_to_report(report, unique) click to toggle source
# File lib/llt/review/treebank/difference/postag.rb, line 30
def write_to_report(report, unique)
  postags = report[:postags]
  postags.add_wrong(unique)
  postags[item.to_s].add_wrong(unique)
end