<commit_before>class Suggestion < ActiveRecord::Base
  attr_accessible :name,
    :occurrence,
    :description,
    :more,
    :place,
    :more_as_text

  serialize :more, Hash

  validates_presence_of :name,
    :occurrence,
    :place

  def more_as_text
    more.map {|key, value| "#{key}: #{value}"}.join "\n"
  end

  def more_as_text=(raw)
    write_attribute "more", Hash[*raw.gsub(": ", "\n").split("\n")]
  end

  def more_as_inline
    more.map {|key, value| "#{key}: #{value}"}.join ", "
  end
end<commit_msg>refactor Suggestion#more_as_inline<commit_after>class Suggestion < ActiveRecord::Base
  attr_accessible :name,
    :occurrence,
    :description,
    :more,
    :place,
    :more_as_text

  serialize :more, Hash

  validates_presence_of :name,
    :occurrence,
    :place

  def more_as_text spacer = "\n"
    more.map {|key, value| "#{key}: #{value}"}.join spacer
  end

  def more_as_text=(raw)
    write_attribute "more", Hash[*raw.gsub(": ", "\n").split("\n")]
  end

  def more_as_inline
    more_as_text ", "
  end
end
{'fraction_non_alphanumeric': 0.15296367112810708, 'fraction_numerical': 0.0, 'mean_word_length': 3.4935622317596566, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 3, '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': '2725086', 'n_tokens_mistral': 403, 'n_tokens_neox': 380, 'n_words': 82}