<commit_before>module GPGStatusParser::Arguments

  # Regexps to extract arguments should have two matchers, the actual
  # argument value and the rest minus whitespace
  NO_WHITESPACE = /([^\s]+)(.*)?/
  USERNAME = /(.+)()$/

  ARGUMENTS = {
    :long_keyid_or_fpr => NO_WHITESPACE,
    :username => USERNAME,
    :keyid => NO_WHITESPACE,
    :pkalgo => NO_WHITESPACE,
    :hashalgo => NO_WHITESPACE,
    :sig_class => NO_WHITESPACE,
    :time => NO_WHITESPACE,
    :rc => NO_WHITESPACE,
    :args => NO_WHITESPACE,
    :radix64_string => NO_WHITESPACE,
    :sig_creation_date => NO_WHITESPACE,
    :sig_version => NO_WHITESPACE,
    :sig_timestamp => NO_WHITESPACE,
    :long_keyid => NO_WHITESPACE,
    :keytype => NO_WHITESPACE,
    :keylength => NO_WHITESPACE,
    :mdc_method => NO_WHITESPACE,
    :sym_algo => NO_WHITESPACE,
    :algo => NO_WHITESPACE,
    :hexdigits => NO_WHITESPACE,
    :what => NO_WHITESPACE,
    :filename => NO_WHITESPACE,
    :long_keyid => NO_WHITESPACE,
    :type => NO_WHITESPACE,
    :pk_algo => NO_WHITESPACE,
    :hash_algo => NO_WHITESPACE,
    :class => NO_WHITESPACE,
    :timestamp => NO_WHITESPACE,
    :keyfpr => NO_WHITESPACE,
    :name => NO_WHITESPACE,
    :string => NO_WHITESPACE,
    :format => NO_WHITESPACE,
    :length => NO_WHITESPACE,
    :arguments => NO_WHITESPACE,
    :flags => NO_WHITESPACE,
    :len => NO_WHITESPACE,
    :pubkey_algo => NO_WHITESPACE,
    :data => NO_WHITESPACE,
    :reserved => NO_WHITESPACE,
    :expire_timestamp => NO_WHITESPACE,
    :long_keyid => NO_WHITESPACE,
    :fingerprint => NO_WHITESPACE,
    :primary_key_fpr => NO_WHITESPACE,
    :fingerprint_in_hex => NO_WHITESPACE,
    :handle => NO_WHITESPACE,
    :error_token => NO_WHITESPACE,
    :zero => /(0)(.*)/,
    :validation_model => NO_WHITESPACE,
    :mailbox => NO_WHITESPACE,
    :long_main_keyid => NO_WHITESPACE,
    :cipher_algo => NO_WHITESPACE,
    :s2k_mode => NO_WHITESPACE,<commit_msg>Additional validation of incoming arguments<commit_after>module GPGStatusParser::Arguments

  # Regexps to extract arguments should have two matchers, the actual
  # argument value and the rest minus whitespace
  NO_WHITESPACE = /([^\s]+)(.*)?/
  USERNAME = /(.+)()$/
  HEX = /([A-Z0-9]+)(.*)?/
  NUMBER = /(\d+)(.*)?/
  DATE = /(\d\d\d\d-\d\d-\d\d)(.*)?/

  ARGUMENTS = {
    :long_keyid_or_fpr => NO_WHITESPACE,
    :username => USERNAME,
    :keyid => NO_WHITESPACE,
    :pkalgo => NO_WHITESPACE,
    :hashalgo => NO_WHITESPACE,
    :sig_class => NO_WHITESPACE,
    :time => NO_WHITESPACE,
    :rc => NO_WHITESPACE,
    :args => NO_WHITESPACE,
    :radix64_string => NO_WHITESPACE,
    :sig_creation_date => DATE,
    :sig_version => NUMBER,
    :sig_timestamp => NUMBER,
    :long_keyid => NO_WHITESPACE,
    :keytype => NO_WHITESPACE,
    :keylength => NO_WHITESPACE,
    :mdc_method => NO_WHITESPACE,
    :sym_algo => NO_WHITESPACE,
    :algo => NO_WHITESPACE,
    :hexdigits => NO_WHITESPACE,
    :what => NO_WHITESPACE,
    :filename => NO_WHITESPACE,
    :long_keyid => NO_WHITESPACE,
    :type => NO_WHITESPACE,
    :pk_algo => NO_WHITESPACE,
    :hash_algo => NUMBER,
    :class => NO_WHITESPACE,
    :timestamp => NO_WHITESPACE,
    :keyfpr => NO_WHITESPACE,
    :name => NO_WHITESPACE,
    :string => NO_WHITESPACE,
    :format => NO_WHITESPACE,
    :length => NO_WHITESPACE,
    :arguments => NO_WHITESPACE,
    :flags => NO_WHITESPACE,
    :len => NO_WHITESPACE,
    :pubkey_algo => NUMBER,
    :data => NO_WHITESPACE,
    :reserved => NUMBER,
    :expire_timestamp => NUMBER,
    :long_keyid => HEX,
    :fingerprint => HEX,
    :primary_key_fpr => HEX,
    :fingerprint_in_hex => HEX,
    :handle => NO_WHITESPACE,
    :error_token => NO_WHITESPACE,
    :zero => /(0)(.*)/,
    :validation_model => NO_WHITESPACE,
    :mailbox => NO_WHITESPACE,
    :long_main_keyid => NO_WHITESPACE,
    :cipher_algo => NO_WHITESPACE,
    :s2k_mode => NO_WHITESPACE,
{'fraction_non_alphanumeric': 0.14051702073201947, 'fraction_numerical': 0.002559508574353724, 'mean_word_length': 3.481651376146789, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 107, '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': '3203703', 'n_tokens_mistral': 1728, 'n_tokens_neox': 1601, 'n_words': 263}