<commit_before>module Seek
  module Search
    class SearchTermFilter
      def self.filter query
        query.strip!
        query = query.gsub("*", "")
        query = query.gsub("?", "")
        query.chop! if query.end_with?(":")

        query = query.strip
        query = "" if query=="-"

        query
      end

    end
  end
end

<commit_msg>filtering search terms mustn't change the current term, as the string may be frozen if it has come form SOLR<commit_after>module Seek
  module Search
    class SearchTermFilter
      def self.filter query
        query = query.strip
        query = query.gsub("*", "")
        query = query.gsub("?", "")
        query = query.chop if query.end_with?(":")

        query = query.strip
        query = "" if query=="-"

        query
      end

    end
  end
end


{'fraction_non_alphanumeric': 0.11260709914320685, 'fraction_numerical': 0.0, 'mean_word_length': 1.963768115942029, 'pattern_counts': {'":': 2, '<': 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': '3295943', 'n_tokens_mistral': 253, 'n_tokens_neox': 239, 'n_words': 75}