<commit_before>module Freeflow
  class Configuration

    class << self
      def registered_filters
        @@registered_filters ||= {}
      end

      def registered_extensions
        registered_filters.keys
      end
    end

    def filter(*args)
      options = args.pop
      filter_name = options.delete(:with)
      exts = args
      exts.each { |ext| self.class.registered_filters[ext.to_sym] = filter_for(filter_name, options) }
    end

    private

    def filter_for(filter_name, options)
      ->(c) { c.filter filter_name, options }
    end
  end
end
<commit_msg>convert extensions to symbols and declare filter once<commit_after>module Freeflow
  class Configuration

    class << self
      def registered_filters
        @@registered_filters ||= {}
      end

      def registered_extensions
        registered_filters.keys
      end
    end

    def filter(*args)
      options = args.pop
      filter_name = options.delete(:with)
      exts = args.map(&:to_sym)
      ftr = filter_for(filter_name, options)
      exts.each { |ext| self.class.registered_filters[ext] = ftr }
    end

    private

    def filter_for(filter_name, options)
      ->(c) { c.filter filter_name, options }
    end
  end
end

{'fraction_non_alphanumeric': 0.08421913327882256, 'fraction_numerical': 0.0, 'mean_word_length': 2.4871794871794872, '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': '3686606', 'n_tokens_mistral': 373, 'n_tokens_neox': 356, 'n_words': 89}