<commit_before>module Pavlov
  module Validations
    def validate_hexadecimal_string param_name, param
      raise Pavlov::ValidationError, "#{param_name.to_s} should be an hexadecimal string." unless /\A[\da-fA-F]+\Z/.match param
    end

    def validate_regex param_name, param, regex, message
      raise Pavlov::ValidationError, "#{param_name.to_s} #{message}" unless regex.match param
    end
  end
end<commit_msg>Added some validations to pavlov<commit_after>module Pavlov
  module Validations
    def validate_hexadecimal_string param_name, param
      raise Pavlov::ValidationError, "#{param_name.to_s} should be an hexadecimal string." unless /\A[\da-fA-F]+\Z/.match param
    end

    def validate_regex param_name, param, regex, message
      raise Pavlov::ValidationError, "#{param_name.to_s} #{message}" unless regex.match param
    end

    def validate_integer param_name, param
      raise Pavlov::ValidationError, "#{param_name.to_s} should be a integer." unless param.is_a? Integer
    end

    def validate_in_set param_name, param, set
      raise Pavlov::ValidationError, "#{param_name.to_s} should be on of these values: #{set.inspect}." unless set.include? param
    end
  end
end
{'fraction_non_alphanumeric': 0.0946058091286307, 'fraction_numerical': 0.0, 'mean_word_length': 4.110169491525424, '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': '5439346', 'n_tokens_mistral': 375, 'n_tokens_neox': 367, 'n_words': 109}