<commit_before>module NumericJson
  def to_json io
    io.write self.to_s
    io
  end
end

class Fixnum; include NumericJson end
class Float; include NumericJson end

class String
  def to_json io
    io.write '"' + self + '"'
    io
  end
end

class Symbol
  def to_json io
    to_s.to_json io
  end
end

class Array
  def to_json io
    io.write '['
    length.times do |i|
      io.write ',' if i > 0
      self[i].to_json io
    end
    io.write ']'
    io
  end
end

class Hash
  def to_json io
    i = 0
    io.write '{'

    each do |key, val|
      io.write ',' if i > 0

      key.to_json io
      io.write ':'
      val.to_json io
      i += 1
    end

    io.write '}'
    io
  end
end

class Time
  def to_json io
    io.printf '"%04d-%02d-%02d %02d:%02d:%02d"', year, month, day, hour, min, sec
  end
end
<commit_msg>[fix] JSON object keys should be strings<commit_after>module NumericJson
  def to_json io
    io.write self.to_s
    io
  end
end

class Fixnum; include NumericJson end
class Float; include NumericJson end

class String
  def to_json io
    io.write '"' + self + '"'
    io
  end
end

class Symbol
  def to_json io
    to_s.to_json io
  end
end

class Array
  def to_json io
    io.write '['
    length.times do |i|
      io.write ',' if i > 0
      self[i].to_json io
    end
    io.write ']'
    io
  end
end

class Hash
  def to_json io
    i = 0
    io.write '{'

    each do |key, val|
      io.write ',' if i > 0

      key.to_s.to_json io
      io.write ':'
      val.to_json io
      i += 1
    end

    io.write '}'
    io
  end
end

class Time
  def to_json io
    io.printf '"%04d-%02d-%02d %02d:%02d:%02d"', year, month, day, hour, min, sec
  end
end

{'fraction_non_alphanumeric': 0.09858323494687131, 'fraction_numerical': 0.018890200708382526, 'mean_word_length': 1.9946996466431095, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6494753', 'n_tokens_mistral': 687, 'n_tokens_neox': 657, 'n_words': 212}