<commit_before>module SPF
  module Query
    class Mechanism

      QUALIFIERS = {
        '+' => :pass,
        '-' => :fail,
        '~' => :soft_fail,
        '?' => :neuatral
      }

      attr_reader :name
      
      attr_reader :value

      attr_reader :qualifier
      
      def initialize(name,options={})
        @name = name

        @value     = options[:value]
        @qualifier = options.fetch(:qualifier,:pass)
      end

      def pass?
        @qualifier == :pass
      end

      def fail?
        @qualifier == :fail
      end

      def soft_fail?
        @qualifier == :soft_fail
      end

      def neutral?
        @qualifier == :neutral
      end

      def to_s
        str = "#{QUALIFIERS.invert[@qualifier]}#{@name}"
        str << ":#{@value}" if value

        return str
      end

    end
  end
end<commit_msg>Default the value of @qualifier in the qualifier reader method.<commit_after>module SPF
  module Query
    class Mechanism

      QUALIFIERS = {
        '+' => :pass,
        '-' => :fail,
        '~' => :soft_fail,
        '?' => :neuatral
      }

      attr_reader :name
      
      attr_reader :value

      def initialize(name,options={})
        @name = name

        @value     = options[:value]
        @qualifier = options[:qualifier]
      end

      def qualifier
        @qualifier || :pass
      end

      def pass?
        @qualifier == :pass || @qualifier.nil?
      end

      def fail?
        @qualifier == :fail
      end

      def soft_fail?
        @qualifier == :soft_fail
      end

      def neutral?
        @qualifier == :neutral
      end

      def to_s
        str = "#{QUALIFIERS.invert[@qualifier]}#{@name}"
        str << ":#{@value}" if value

        return str
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.11668545659526494, 'fraction_numerical': 0.0, 'mean_word_length': 1.5393419170243205, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 11, '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': '2730077', 'n_tokens_mistral': 566, 'n_tokens_neox': 544, 'n_words': 132}