<commit_before>namespace :friendly do
  desc <<-EOF
   Rebuild the Friendly indices. E.g.:
     FIELDS="name,owner" rake friendly:build_index[Product]
  EOF
  task :build_index, :class_name, :needs => [:environment] do |t, args|
    klass  = args[:class_name].constantize
    fields = ENV['FIELDS'].split(',').map { |f| f.to_sym }
    Friendly::Indexer.populate(klass, *fields)
  end

  desc <<-EOF
    Create the tables for a particular Friendly based model, e.g:
      rake friendly:create_tables[Product]
  EOF
  task :create_tables, :class_name, :needs => [:environment] do |t, args|
    args[:class_name].constantize.create_tables!
  end
end<commit_msg>renaming to make it clear what the individual tasks do<commit_after>namespace :friendly do
  desc <<-EOF
    Rebuild the Friendly indices. E.g.:
      FIELDS="name,owner" rake friendly:build_index[Product]
    would populate the index for name+owner (i.e. not name, owner).
  EOF
  task :populate_index, :class_name, :needs => [:environment] do |t, args|
    klass  = args[:class_name].constantize
    fields = ENV['FIELDS'].split(',').map { |f| f.to_sym }
    Friendly::Indexer.populate(klass, *fields)
  end

  desc <<-EOF
    Create the tables for a particular Friendly based model, e.g:
      rake friendly:create_tables[Product]
    This also creates the index tables.
  EOF
  task :create_all_tables_for, :class_name, :needs => [:environment] do |t, args|
    args[:class_name].constantize.create_tables!
  end
end
{'fraction_non_alphanumeric': 0.12449255751014884, 'fraction_numerical': 0.0, 'mean_word_length': 4.030612244897959, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '2063656', 'n_tokens_mistral': 500, 'n_tokens_neox': 490, 'n_words': 138}