<commit_before>require 'adapter'

Adapter.define(:memory) do
  def read(key)
    decode(client[key_for(key)])
  end

  def write(key, value)
    client[key_for(key)] = encode(value)
  end

  def delete(key)
    read(key).tap { client.delete(key_for(key)) }
  end

  def clear
    client.clear
  end
end<commit_msg>Switched memory to use a module to make it more obvious how to override it.<commit_after>require 'adapter'

module Adapter
  module Memory
    def read(key)
      decode(client[key_for(key)])
    end

    def write(key, value)
      client[key_for(key)] = encode(value)
    end

    def delete(key)
      read(key).tap { client.delete(key_for(key)) }
    end

    def clear
      client.clear
    end
  end
end

Adapter.define(:memory, Adapter::Memory)
{'fraction_non_alphanumeric': 0.10966057441253264, 'fraction_numerical': 0.0, 'mean_word_length': 3.2142857142857144, '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': '3267591', 'n_tokens_mistral': 268, 'n_tokens_neox': 259, 'n_words': 66}