<commit_before>module AcademicBenchmark

class Standard
  def initialize(data, parent=nil)
    @data = data
    @parent = parent
    @children = []

    return if type == 'course'

    if has_items?
      items.each do |itm|
        Standard.new(itm, self)
      end
    end

    # ignore course types and leaves that don't have a num
    if num || @children.any?
      @parent.add_child(self) if parent
    end
  end

  def build_outcomes
    hash = {:migration_id => guid, :vendor_guid => guid, :low_grade => low_grade, :high_grade => high_grade, :is_global_standard => true}
    hash[:description] = description
    if is_leaf?
      # create outcome
      hash[:type] = 'learning_outcome'
      hash[:title] = build_num_title
      set_default_ratings(hash)
    else
      #create outcome group
      hash[:type] = 'learning_outcome_group'
      hash[:title] = build_title
      hash[:outcomes] = []
      @children.each do |chld|
        hash[:outcomes] << chld.build_outcomes<commit_msg>grab all AB Standards not just grade types<commit_after>module AcademicBenchmark

class Standard
  def initialize(data, parent=nil)
    @data = data
    @parent = parent
    @children = []

    if has_items?
      items.each do |itm|
        Standard.new(itm, self)
      end
    end

    # ignore course types and leaves that don't have a num
    if num || @children.any?
      @parent.add_child(self) if parent
    end
  end

  def build_outcomes
    hash = {:migration_id => guid, :vendor_guid => guid, :low_grade => low_grade, :high_grade => high_grade, :is_global_standard => true}
    hash[:description] = description
    if is_leaf?
      # create outcome
      hash[:type] = 'learning_outcome'
      hash[:title] = build_num_title
      set_default_ratings(hash)
    else
      #create outcome group
      hash[:type] = 'learning_outcome_group'
      hash[:title] = build_title
      hash[:outcomes] = []
      @children.each do |chld|
        hash[:outcomes] << chld.build_outcomes
{'fraction_non_alphanumeric': 0.10388300554715078, 'fraction_numerical': 0.0, 'mean_word_length': 2.8449612403100777, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4627927', 'n_tokens_mistral': 634, 'n_tokens_neox': 619, 'n_words': 164}