<commit_before>module ErrorStore
  class BaseInterface
    include ErrorStore::Utils
    attr_accessor :_data

    def initialize(error)
      @error = error
      @_data  = {}
    end

    def name
      self.class.display_name
    end

    def type
      self.class.type
    end

    def self.available
      # driver available if not rails test
      return !Rails.env.test?
    end

    def to_json
      # keep only values of zero and not blank
      return _data.delete_if { |k, v| v == 0 || v.blank? }
    end
  end
end
<commit_msg>add get_hash and compute_hashes to base_interface methods<commit_after>module ErrorStore
  class BaseInterface
    include ErrorStore::Utils
    attr_accessor :_data

    def initialize(error)
      @error = error
      @_data  = {}
    end

    def name
      self.class.display_name
    end

    def type
      self.class.type
    end

    def self.available
      # driver available if not rails test
      return !Rails.env.test?
    end

    def to_json
      # keep only values of zero and not blank
      return _data.delete_if { |k, v| v == 0 || v.blank? }
    end

    def get_hash
      return []
    end

    def compute_hashes(platform)
      result = self.get_hash()
      return [] unless result
      return [result]
    end
  end
end

{'fraction_non_alphanumeric': 0.06671838634600466, 'fraction_numerical': 0.0015515903801396431, 'mean_word_length': 2.0641330166270784, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1987635', 'n_tokens_mistral': 408, 'n_tokens_neox': 391, 'n_words': 126}