<commit_before># encoding: UTF-8

module Watchmaker
  module Learner
    extend ActiveSupport::Concern

    module ClassMethods

      # Learn a profile by taking explicit dependencies.
      #
      def learn(name, dependencies = {}, &block)

        if name.is_a?(Hash)
          
          # Convert the hash into a profile name and a list of
          # dependencies that's either a hash of nested classes or
          # array.
          #
          name, dependencies = 
            name_and_dependencies_from_dependency_hash(name) 

          # Specifically store these as abstract dependencies.
          #
          dependencies = { :abstract => dependencies }

        end

        Configuration.learn(name, dependencies, &block)
      end

      # Get the profile name out of a dependency hash.
      #
      def name_and_dependencies_from_dependency_hash(dependencies)
        name = dependencies.keys.first
        [name, dependencies[name]]
      end

    end
  end
end<commit_msg>Missed one learn, upgrade to new syntax.<commit_after># encoding: UTF-8

module Watchmaker
  module Learner
    extend ActiveSupport::Concern

    module ClassMethods

      # Learn a profile by taking explicit dependencies.
      #
      def define(name, dependencies = {}, &block)

        if name.is_a?(Hash)
          
          # Convert the hash into a profile name and a list of
          # dependencies that's either a hash of nested classes or
          # array.
          #
          name, dependencies = 
            name_and_dependencies_from_dependency_hash(name) 

          # Specifically store these as abstract dependencies.
          #
          dependencies = { :abstract => dependencies }

        end

        Configuration.learn(name, dependencies, &block)
      end

      alias :learn :define

      # Get the profile name out of a dependency hash.
      #
      def name_and_dependencies_from_dependency_hash(dependencies)
        name = dependencies.keys.first
        [name, dependencies[name]]
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.06164383561643835, 'fraction_numerical': 0.0009784735812133072, 'mean_word_length': 2.061377245508982, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5492590', 'n_tokens_mistral': 531, 'n_tokens_neox': 493, 'n_words': 170}