<commit_before>module Nawl
  # The null object will respond to any message with nil. When converted to
  # other objects, it chooses sane "empty" values.
  class NullObject
    def to_s
      ''
    end

    def to_a
      []
    end

    def to_h
      {}
    end

    def to_i
      0
    end

    def to_f
      0.0
    end

    def method_missing(name, *args)
      nil
    end

    def inspect
      '#<NullObject:0x%08x>' % (object_id * 2)
    end
  end
end<commit_msg>Let NullObject return itself instead of nil<commit_after>module Nawl
  # The null object will respond to any message with nil. When converted to
  # other objects, it chooses sane "empty" values.
  class NullObject
    def to_s
      ''
    end

    def to_a
      []
    end

    def to_h
      {}
    end

    def to_i
      0
    end

    def to_f
      0.0
    end

    def method_missing(name, *args)
      self
    end

    def inspect
      '#<NullObject:0x%08x>' % (object_id * 2)
    end
  end
end
{'fraction_non_alphanumeric': 0.0652395514780836, 'fraction_numerical': 0.014271151885830785, 'mean_word_length': 1.7507002801120448, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2063596', 'n_tokens_mistral': 350, 'n_tokens_neox': 331, 'n_words': 113}