<commit_before>require 'colorize'

module HipchatSearcher
  class SearchProxy
    class Simple
      def initialize(pattern, result, options={})
        @result     = result
        @options    = options
        @pattern    = Regexp.new(pattern, Regexp::IGNORECASE)
      end

      attr_reader :pattern

      def self.search(pattern, result, options)
        new(pattern, result, options).search
      end

      def items
        @items ||= @result.items
      end

      def puts_search_result(item)
        if option_user?
          if @options[:user] == item.mention_name
            puts_contents(item)
          end
        else
          puts_contents(item)
        end
      end

      def search<commit_msg>* place upstream more recently comment<commit_after>require 'colorize'

module HipchatSearcher
  class SearchProxy
    class Simple
      def initialize(pattern, result, options={})
        @result     = result
        @options    = options
        @pattern    = Regexp.new(pattern, Regexp::IGNORECASE)
      end

      attr_reader :pattern

      def self.search(pattern, result, options)
        new(pattern, result, options).search
      end

      def items
        @items ||= @result.items.reverse
      end

      def puts_search_result(item)
        if option_user?
          if @options[:user] == item.mention_name
            puts_contents(item)
          end
        else
          puts_contents(item)
        end
      end

      def search
{'fraction_non_alphanumeric': 0.0762423417290674, 'fraction_numerical': 0.0, 'mean_word_length': 1.9341317365269461, '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': '5889813', 'n_tokens_mistral': 415, 'n_tokens_neox': 407, 'n_words': 104}