<commit_before>module IDology
  class Response
    include HappyMapper
    
    element :id, Integer, :tag => 'id-number'
    element :failed, String
    element :error, String
    element 'iq-summary-result', String
    element :iq_indicated, IDology::Boolean, :tag => 'idliveq-indicated', :parser => :parse
    element :eligible_for_questions, IDology::Boolean, :tag => 'eligible-for-questions', :parser => :parse
    
    has_one :result, IDology::Result
    has_one :summary_result, IDology::SummaryResult
    has_one :iq_result, IDology::IQResult
    has_one :iq_challenge_result, IDology::IQChallengeResult
    has_one :iq_error, IDology::IQError
    has_many :qualifiers, IDology::Qualifier
    has_many :questions, IDology::Question
    has_many :velocity_results, IDology::VelocityResult
    
    # A helper method as this can be an element or in the iq_error
    def ineligible_for_questions?
      eligible_for_questions == false || (iq_error && %w(id.not.eligible.for.questions result.questions.no.data).include?(iq_error.key))
    end
    
    def eligible_for_verification?
      !error? && result && result.match? && (!ineligible_for_questions? || questions)
    end<commit_msg>Change tag to string<commit_after>module IDology
  class Response
    include HappyMapper
    
    element :id, Integer, :tag => 'id-number'
    element :failed, String
    element :error, String
    element :iq_summary_result, String, :tag => 'iq-summary-result'
    element :iq_indicated, IDology::Boolean, :tag => 'idliveq-indicated', :parser => :parse
    element :eligible_for_questions, IDology::Boolean, :tag => 'eligible-for-questions', :parser => :parse
    
    has_one :result, IDology::Result
    has_one :summary_result, IDology::SummaryResult
    has_one :iq_result, IDology::IQResult
    has_one :iq_challenge_result, IDology::IQChallengeResult
    has_one :iq_error, IDology::IQError
    has_many :qualifiers, IDology::Qualifier
    has_many :questions, IDology::Question
    has_many :velocity_results, IDology::VelocityResult
    
    # A helper method as this can be an element or in the iq_error
    def ineligible_for_questions?
      eligible_for_questions == false || (iq_error && %w(id.not.eligible.for.questions result.questions.no.data).include?(iq_error.key))
    end
    
    def eligible_for_verification?
      !error? && result && result.match? && (!ineligible_for_questions? || questions)
    end
{'fraction_non_alphanumeric': 0.10780669144981413, 'fraction_numerical': 0.0, 'mean_word_length': 4.208602150537635, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, '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': '4892278', 'n_tokens_mistral': 773, 'n_tokens_neox': 732, 'n_words': 178}