<commit_before>module CodeRay
module Encoders
  
  load :filter
  
  class TokenClassFilter < Filter

    include Streamable
    register_for :token_class_filter

    DEFAULT_OPTIONS = {
      :exclude => [],
      :include => :all
    }

  protected
    def setup options
      super
      @exclude = options[:exclude]
      @include = options[:include]
    end
    
    def text_token text, kind
      [text, kind] if !@exclude.include?(kind) &&
        (@include == :all || @include.include?(kind))
    end

  end

end
end<commit_msg>TokenClassFilter: Support for :exclud => :all.<commit_after>module CodeRay
module Encoders
  
  load :filter
  
  class TokenClassFilter < Filter

    include Streamable
    register_for :token_class_filter

    DEFAULT_OPTIONS = {
      :exclude => [],
      :include => :all
    }

  protected
    def setup options
      super
      @exclude = options[:exclude]
      @include = options[:include]
    end
    
    def text_token text, kind
      [text, kind] if \
         (@include == :all || @include.include?(kind)) &&
        !(@exclude == :all || @exclude.include?(kind))
    end

  end

end
end
{'fraction_non_alphanumeric': 0.10789473684210527, 'fraction_numerical': 0.0, 'mean_word_length': 2.4367469879518073, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '1678750', 'n_tokens_mistral': 357, 'n_tokens_neox': 342, 'n_words': 89}