<commit_before>class Cronicle::Utils
  class << self
    def regexp_union(list)
      list = [list].flatten.compact
      return nil if list.empty?

      Regexp.union(list.map {|str_or_reg|
        if str_or_reg.kind_of?(Regexp)
          str_or_reg
        else
          /\A#{str_or_reg}\z/
        end
      })
    end
  end # of class methods
end
<commit_msg>Fix utils<commit_after>class Cronicle::Utils
  class << self
    def regexp_union(list)
      return nil if list.nil?
      return list if list.kind_of?(Regexp)

      list = [list].flatten.compact
      return nil if list.empty?

      Regexp.union(list.map {|str_or_reg|
        if str_or_reg.kind_of?(Regexp)
          str_or_reg
        else
          /\A#{str_or_reg}\z/
        end
      })
    end
  end # of class methods
end

{'fraction_non_alphanumeric': 0.09774436090225563, 'fraction_numerical': 0.0, 'mean_word_length': 1.9925093632958801, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5247661', 'n_tokens_mistral': 284, 'n_tokens_neox': 278, 'n_words': 61}