<commit_before># encoding: utf-8

class String
  def slugify
    trans_table = YAML.load_file("#{RAILS_ROOT}/config/trans_table.yml")
    str = self.mb_chars.downcase
    str.each_char.map {|c| trans_table[c] || c }.join.gsub(/[\W_]+/, "-")
  end
  alias :to_slug :slugify
end<commit_msg>Added the `spacer` parameter.<commit_after># encoding: utf-8

class String
  def slugify(spacer="-")
    trans_table = YAML.load_file("#{RAILS_ROOT}/config/trans_table.yml")
    str = self.mb_chars.downcase
    str.each_char.map {|c| trans_table[c] || c }.join.gsub(/[\W_]+/, spacer)
  end
  alias :to_slug :slugify
end
{'fraction_non_alphanumeric': 0.16474464579901152, 'fraction_numerical': 0.0032948929159802307, 'mean_word_length': 4.024793388429752, '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': '3767068', 'n_tokens_mistral': 245, 'n_tokens_neox': 241, 'n_words': 45}