class LLT::Review::Treebank::Report::Postags

Public Class Methods

new(total = 1) click to toggle source
# File lib/llt/review/treebank/report/postags.rb, line 4
def initialize(total = 1)
  super(:postags, total)
end

Public Instance Methods

collect_reports(words) click to toggle source
# File lib/llt/review/treebank/report/postags.rb, line 8
def collect_reports(words)
  words.each do |_, word|
    postag = word[:postag]
    add(Postag.new(postag.to_s))
    add(postag.report)
  end
end
sort() click to toggle source

Sorting is all good, but we want the postags to show up in front of the datapoints

Calls superclass method LLT::Review::Helpers::Reportable#sort
# File lib/llt/review/treebank/report/postags.rb, line 18
def sort
  shifter = :datapoints
  sorted = super
  sorted[shifter] = sorted.delete(shifter)
  sorted
end