<commit_before>module Experian
  module PreciseId
    class Response < Experian::Response
      def success?
        super && has_precise_id_section? && !error?
      end

      def error?
        super || !has_precise_id_section? || has_error_section?
      end

      def error_code
        has_error_section? ? error_section["ErrorCode"] : nil
      end

      def error_message
        if has_error_section?
          error_message = error_section["ErrorDescription"]
        else
          error_message = nil
        end

        super || error_message
      end

      def session_id
        hash_path(@response,"Products","PreciseIDServer","SessionID")
      end

      def fpd_score
        hash_path(@response,"Products","PreciseIDServer","Summary","FPDScore")
      end

      def score
        hash_path(@response,"Products","PreciseIDServer","Summary","PreciseIDScore")
      end

      def initial_decision
        hash_path(@response,"Products","PreciseIDServer","Summary","InitialResults","InitialDecision")
      end

      def final_decision
        hash_path(@response,"Products","PreciseIDServer","Summary","InitialResults","FinalDecision")
      end

      def accept_refer_code
        hash_path(@response,"Products","PreciseIDServer","KBAScore","ScoreSummary","AcceptReferCode")
      end

      def questions
        questions = hash_path(@response,"Products","PreciseIDServer","KBA","QuestionSet")<commit_msg>Add dl validation and ssn code helper methods<commit_after>module Experian
  module PreciseId
    class Response < Experian::Response
      def success?
        super && has_precise_id_section? && !error?
      end

      def error?
        super || !has_precise_id_section? || has_error_section?
      end

      def error_code
        has_error_section? ? error_section["ErrorCode"] : nil
      end

      def error_message
        if has_error_section?
          error_message = error_section["ErrorDescription"]
        else
          error_message = nil
        end

        super || error_message
      end

      def session_id
        hash_path(@response,"Products","PreciseIDServer","SessionID")
      end

      def fpd_score
        hash_path(@response,"Products","PreciseIDServer","Summary","FPDScore")
      end

      def score
        hash_path(@response,"Products","PreciseIDServer","Summary","PreciseIDScore")
      end

      def initial_decision
        hash_path(@response,"Products","PreciseIDServer","Summary","InitialResults","InitialDecision")
      end

      def final_decision
        hash_path(@response,"Products","PreciseIDServer","Summary","InitialResults","FinalDecision")
      end

      def accept_refer_code
        hash_path(@response,"Products","PreciseIDServer","KBAScore","ScoreSummary","AcceptReferCode")
      end

      def drivers_license_format_validation
        hash_path(@response,"Products","PreciseIDServer","Checkpoint","ValidationSegment", "DriversLicenseFormatValidation")
      end

      def ssn_code
        hash_path(@response,"Products","PreciseIDServer","GLBDetail","CheckpointSummary", "SSNCode")
      end

      def questions
        questions = hash_path(@response,"Products","PreciseIDServer","KBA","QuestionSet")
{'fraction_non_alphanumeric': 0.10464029897228277, 'fraction_numerical': 0.0, 'mean_word_length': 3.215223097112861, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3728388', 'n_tokens_mistral': 903, 'n_tokens_neox': 841, 'n_words': 148}