<commit_before>module DiviningRod
  class Mappings

    class << self

      attr_accessor :root_definition

      def define(opts = {})
        @root_definition = Definition.new(opts) { true }
        yield Mappings.new(@root_definition)
        @root_definition
      end

      def evaluate(obj)
        @root_definition.evaluate(obj)
      end

    end

    attr_reader :default_opts, :parent

    def initialize(parent, default_opts = {})
      @parent = parent
      unless default_opts == {}
        p "Passed in default_opts"
        p default_opts
      end
      @default_opts = Mash.new(default_opts)
    end

    def pattern(type, pattern, opts = {})
      definition = Matchers.send(type.to_sym, pattern, merged_opts(opts))
      append_to_parent(definition)
      if block_given?
        yield self.class.new(definition)
      end
      definition
    end

    def default(opts = {})
      definition = Definition.new(merged_opts(opts)) { true }
      append_to_parent(definition)
      definition<commit_msg>removing debug statement<commit_after>module DiviningRod
  class Mappings

    class << self

      attr_accessor :root_definition

      def define(opts = {})
        @root_definition = Definition.new(opts) { true }
        yield Mappings.new(@root_definition)
        @root_definition
      end

      def evaluate(obj)
        @root_definition.evaluate(obj)
      end

    end

    attr_reader :default_opts, :parent

    def initialize(parent, default_opts = {})
      @parent = parent
      @default_opts = Mash.new(default_opts)
    end

    def pattern(type, pattern, opts = {})
      definition = Matchers.send(type.to_sym, pattern, merged_opts(opts))
      append_to_parent(definition)
      if block_given?
        yield self.class.new(definition)
      end
      definition
    end

    def default(opts = {})
      definition = Definition.new(merged_opts(opts)) { true }
      append_to_parent(definition)
      definition
{'fraction_non_alphanumeric': 0.08788962698007154, 'fraction_numerical': 0.0, 'mean_word_length': 2.5471014492753623, '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': '6059979', 'n_tokens_mistral': 578, 'n_tokens_neox': 559, 'n_words': 122}