<commit_before>module Dragonfly
  class Analyser < FunctionManager
    
    include Configurable
    configurable_attr :enable_cache, true
    configurable_attr :cache_size, 1000
    
    def initialize
      super
      analyser = self
      @analysis_methods = Module.new do

        define_method :analyser do
          analyser
        end
        
      end
      @analysis_method_names = []
    end
    
    attr_reader :analysis_methods, :analysis_method_names
    
    def analyse(temp_object, method, *args)
      if enable_cache
        key = [temp_object.object_id, method, *args]
        cache[key] ||= call_last(method, temp_object, *args)
      else<commit_msg>Probs only need default 100 analyser cache size<commit_after>module Dragonfly
  class Analyser < FunctionManager
    
    include Configurable
    configurable_attr :enable_cache, true
    configurable_attr :cache_size, 100
    
    def initialize
      super
      analyser = self
      @analysis_methods = Module.new do

        define_method :analyser do
          analyser
        end
        
      end
      @analysis_method_names = []
    end
    
    attr_reader :analysis_methods, :analysis_method_names
    
    def analyse(temp_object, method, *args)
      if enable_cache
        key = [temp_object.object_id, method, *args]
        cache[key] ||= call_last(method, temp_object, *args)
      else
{'fraction_non_alphanumeric': 0.06073752711496746, 'fraction_numerical': 0.0072306579898770785, 'mean_word_length': 2.4088669950738915, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2611709', 'n_tokens_mistral': 410, 'n_tokens_neox': 401, 'n_words': 100}