<commit_before>class Story < Empirical::Client::Endpoints::Activity

  # attributes :body, :instructions

  attr_accessor :chunks, :parsed

  def assessment
    self
  end

  def chunks
    @chunks ||= GrammarChunker.chunk(parsed)
  end
  delegate :questions, to: :chunks

  def body_parser
    body = YAML.load(activity.data.body).gsub("\n", "<br>").html_safe

  end


  def parsed
    @parsed ||= GrammarParser.new.parse(body_parser)[:questions]
  end

  def question_quantity_for_rule rule
    3
  end

  def as_json
    {
      body: YAML.load(activity.data.body),
      id: id
    }
  end

  def to_json
    as_json.to_json
  end

end

<commit_msg>Fix a bug for form_for<commit_after>class Story < Empirical::Client::Endpoints::Activity

  # attributes :body, :instructions

  attr_accessor :chunks, :parsed

  def assessment
    self
  end

  def chunks
    @chunks ||= GrammarChunker.chunk(parsed)
  end
  delegate :questions, to: :chunks

  def body_parser
    body = YAML.load(activity.data.body).gsub("\n", "<br>").html_safe

  end

  def model_name
    ActiveModel::Name.new(Story)
  end


  def parsed
    @parsed ||= GrammarParser.new.parse(body_parser)[:questions]
  end

  def question_quantity_for_rule rule
    3
  end

  def as_json
    {
      body: YAML.load(activity.data.body),
      id: id
    }
  end

  def to_json
    as_json.to_json
  end

end


{'fraction_non_alphanumeric': 0.10276967930029154, 'fraction_numerical': 0.0014577259475218659, 'mean_word_length': 3.026392961876833, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '3580915', 'n_tokens_mistral': 511, 'n_tokens_neox': 481, 'n_words': 108}