<commit_before>class SiteDecorator < BaseDecorator
  DOMAIN_URL_SCHEME = "http://"

  def initialize(site)
    @object = site
  end

  def to_s
    object.name
  end

  def domain_url
    if object.domain.starts_with?(DOMAIN_URL_SCHEME)
      object.domain
    else
      "#{DOMAIN_URL_SCHEME}#{object.domain}"
    end
  end
end<commit_msg>Add methods to use organization name with locale inflections<commit_after>class SiteDecorator < BaseDecorator
  DOMAIN_URL_SCHEME = "http://"

  def initialize(site)
    @object = site
  end

  def to_s
    object.name
  end

  def organization_name
    @organization_name ||= object.organization_name
  end

  def determined_organization_name(determinative)
    I18n::Inflections::Base.create_with_locale(organization_name, gender: organization_name_gender).send(determinative)
  end

  def organization_name_gender
    if object.configuration.configuration_variables.has_key? "organization_name_gender"
      (object.configuration.configuration_variables["organization_name_gender"][I18n.locale.to_s] || :n).to_sym
    else
      :n
    end
  end

  def domain_url
    if object.domain.starts_with?(DOMAIN_URL_SCHEME)
      object.domain
    else
      "#{DOMAIN_URL_SCHEME}#{object.domain}"
    end
  end
end
{'fraction_non_alphanumeric': 0.0815347721822542, 'fraction_numerical': 0.0031974420463629096, 'mean_word_length': 3.9098039215686273, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4531488', 'n_tokens_mistral': 428, 'n_tokens_neox': 414, 'n_words': 77}