<commit_before># encoding: utf-8

require 'yaml'
require 'ostruct'
require 'htmlentities'

# FontAwesome class
class FontAwesome
  attr_reader :icons

  ICONS = YAML.load_file(File.expand_path('./icons.yml'))['icons']

  # FontAwesome::Icon class
  class Icon
    attr_reader :id, :unicode

    def initialize(id)
      @id = id
      unicode = find_unicode_from_id(id)
      @unicode = unicode ? unicode : find_unicode_from_aliases(id)
    end

    def find_unicode_from_id(id)
      found_icon = ICONS.find { |icon| icon['id'] == id }
      found_icon ? found_icon['unicode'] : nil
    end

    def find_unicode_from_aliases(id)
      found_icon = ICONS.find do |icon|
        icon['aliases'].include?(id) if icon['aliases']
      end
      found_icon ? found_icon['unicode'] : nil
    end
  end

  def self.argv(argv)
    split_argv = argv[0].chomp.split('|||')
    os = OpenStruct.new
    os.icon_id = split_argv[0]
    os.icon_unicode = split_argv[1]
    os
  end

  def self.css_class_name(icon_id)
    "fa-#{icon_id}"
  end

  def self.character_reference(character_code)
    HTMLEntities.new.decode("&#x#{character_code};")
  end

  def self.url(icon_id)
    "http://fontawesome.io/icon/#{icon_id}/"
  end

  def initialize(queries = [])<commit_msg>Refactor argument name<commit_after># encoding: utf-8

require 'yaml'
require 'ostruct'
require 'htmlentities'

# FontAwesome class
class FontAwesome
  attr_reader :icons

  ICONS = YAML.load_file(File.expand_path('./icons.yml'))['icons']

  # FontAwesome::Icon class
  class Icon
    attr_reader :id, :unicode

    def initialize(id)
      @id = id
      unicode = find_unicode_from_id(id)
      @unicode = unicode ? unicode : find_unicode_from_aliases(id)
    end

    def find_unicode_from_id(id)
      found_icon = ICONS.find { |icon| icon['id'] == id }
      found_icon ? found_icon['unicode'] : nil
    end

    def find_unicode_from_aliases(id)
      found_icon = ICONS.find do |icon|
        icon['aliases'].include?(id) if icon['aliases']
      end
      found_icon ? found_icon['unicode'] : nil
    end
  end

  def self.argv(argv)
    split_argv = argv[0].chomp.split('|||')
    os = OpenStruct.new
    os.icon_id = split_argv[0]
    os.icon_unicode = split_argv[1]
    os
  end

  def self.css_class_name(icon_id)
    "fa-#{icon_id}"
  end

  def self.character_reference(icon_unicode)
    HTMLEntities.new.decode("&#x#{icon_unicode};")
  end

  def self.url(icon_id)
    "http://fontawesome.io/icon/#{icon_id}/"
  end

  def initialize(queries = [])
{'fraction_non_alphanumeric': 0.12862246923382295, 'fraction_numerical': 0.0031758634378721714, 'mean_word_length': 3.2930153321976148, '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': '2825482', 'n_tokens_mistral': 952, 'n_tokens_neox': 903, 'n_words': 176}