<commit_before>module Audit
  class ReputationData

    def self.add(character, data)
      reps = {}
      rep_value = 0

      REPUTATIONS[character.data['faction']].each do |reputation, name|
        match = false

        data['reputation'].each do |rep_data|
          if rep_data['id'] == reputation
            character.data["#{name}_standing"] = STANDINGS[rep_data['standing']]

            character.data["#{name}_value"] = rep_data['value']

            rep_value += ( ( rep_data['standing'] - 2 ) +
                           ( rep_data['value'].to_f / REP_AMOUNT[rep_data['standing']].to_f ) )
            match = true
          end
        end

        if not match
          character.data["#{name}_standing"] = 'Neutral'
          character.data["#{name}_value"] = 0
        end
      end

      character.data['reputation_ranking'] =
        data['achievements']['criteriaQuantity'][data['achievements']['criteria'].index(982)]
      character.data['exalted_amount'] = exalted_rep_amount / REPUTATIONS[character.data['faction']].length
    end
  end
end<commit_msg>Oopsie.<commit_after>module Audit
  class ReputationData

    def self.add(character, data)
      reps = {}
      rep_value = 0

      REPUTATIONS[character.data['faction']].each do |reputation, name|
        match = false

        data['reputation'].each do |rep_data|
          if rep_data['id'] == reputation
            character.data["#{name}_standing"] = STANDINGS[rep_data['standing']]

            character.data["#{name}_value"] = rep_data['value']

            rep_value += ( ( rep_data['standing'] - 2 ) +
                           ( rep_data['value'].to_f / REP_AMOUNT[rep_data['standing']].to_f ) )
            match = true
          end
        end

        if not match
          character.data["#{name}_standing"] = 'Neutral'
          character.data["#{name}_value"] = 0
        end
      end

      character.data['reputation_ranking'] = rep_value
      character.data['exalted_amount'] =
        data['achievements']['criteriaQuantity'][data['achievements']['criteria'].index(982)]
    end
  end
end
{'fraction_non_alphanumeric': 0.14278914802475012, 'fraction_numerical': 0.005711565920990005, 'mean_word_length': 2.406807131280389, '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': '5193316', 'n_tokens_mistral': 656, 'n_tokens_neox': 621, 'n_words': 102}