<commit_before>module RepoXp
  class BaseRepository
    attr_reader :adapter

    class << self
      def entity_class
        self.name =~ /(.+)Repository$/ and Object.const_get($1)
      end
    end

    def initialize(config = :default)
      raise "whoa buddy, let's not get crazy here" unless config == :default
    end

    def entity_class
      self.class.entity_class
    end

    def save
      adapter.save
    end

    def find_by_id(id)
      adapter.find_by_id(id)
    end
  end
end<commit_msg>magic constants<commit_after>module RepoXp
  class BaseRepository
    attr_reader :adapter

    ENTITY_NAME_PATTERN = /(.+)Repository$/

    class << self
      def entity_class
        self.name =~ ENTITY_NAME_PATTERN and Object.const_get($1)
      end
    end

    def initialize(config = :default)
      raise "whoa buddy, let's not get crazy here" unless config == :default
    end

    def entity_class
      self.class.entity_class
    end

    def save
      adapter.save
    end

    def find_by_id(id)
      adapter.find_by_id(id)
    end
  end
end
{'fraction_non_alphanumeric': 0.07417840375586854, 'fraction_numerical': 0.0018779342723004694, 'mean_word_length': 2.352201257861635, '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': '4986742', 'n_tokens_mistral': 357, 'n_tokens_neox': 333, 'n_words': 92}