<commit_before># desc "Explaining what the task does"
# task :selectable_attr do
#   # Task goes here
# end

# name_space :i18n do
#   name_space :selectable_attr do
#     task :export do
      
#     end
#   end
# end<commit_msg>rake i18n:selectable_attr:exportを実装しました。<commit_after>require 'yaml'

namespace :i18n do
  namespace :selectable_attr do
    task :load_all_models => :environment do
      Dir.glob(File.join(RAILS_ROOT, 'app', 'models', '**', '*.rb')) do |file_name|
        require file_name
      end
    end
    
    desc "Export i18n resources for selectable_attr entries"
    task :export => :"i18n:selectable_attr:load_all_models" do
      puts YAML.dump(SelectableAttr::Enum.i18n_export)
    end
  end
end
{'fraction_non_alphanumeric': 0.10206896551724139, 'fraction_numerical': 0.016551724137931035, 'mean_word_length': 3.5375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5265008', 'n_tokens_mistral': 266, 'n_tokens_neox': 257, 'n_words': 64}