<commit_before># encoding: UTF-8
# Tasks for generating bulk data
namespace :app do
  namespace :factory do
    FIRST_NAMES = %w(<NAME> Ingrid Em<NAME> Ulla Annika Mon<NAME>sa Anette I<NAME>andra Siv Ann Anneli Therese Cecilia <NAME>lrika El<NAME>becka Agneta S<NAME> Birgit Ann-Marie Inga Sonja Alice Mona L<NAME> Astrid Ann-Christin Ebba Klara Gunnel Erika Isabelle Britt-Marie Nathalie Moa Alexandra Viktoria Gerd Britta Ellen Irene Lisbeth Pernilla Maj Ella Wil<NAME>icia Charlotte Ingela Emilia)
    LAST_NAMES = %w(<NAME>qvist Lindgren <NAME>m Lundgren Lundqvist <NAME>ström <NAME>qvist <NAME>fgren <NAME>öderberg Nyberg Blomqvist Mårtensson Nordström Lundström Eliasson Pålsson Björklund Viklund Berggren Sandström Nordin Lund Ström Hermansson Åberg Ekström Holmgren Sundberg Hedlund Dahlberg Hellström Sjögren Abrahamsson F<NAME> Ek Åkesson Strömberg Jonasson Hansen Norberg Sundström Åström Holmqvist Lindholm Sundqvist Ivarsson)

    task students: :environment do
      num = (ENV["num"] || 10).to_i
      1.upto(num) do
        student = FactoryGirl.create(:student, name: "#{FIRST_NAMES.sample} #{LAST_NAMES.sample}")
        puts "New student: #{student.name}"
      end
    end
  end
end
<commit_msg>Rake task for generating suites with evaluations and results<commit_after># encoding: UTF-8
# Tasks for generating bulk data
namespace :app do
  namespace :factory do
    FIRST_NAMES = %w(<NAME>ara Ingrid Em<NAME>ger Ulla Annika Monica Linda Susanne E<NAME> J<NAME> Sofia Katar<NAME> Marianne Anita <NAME> Åsa Anette Ida Gunilla Linnéa Cam<NAME> Sandra Siv Ann Anneli Therese Cecilia <NAME> Amanda Gun Lisa <NAME> Ulrika Elsa Berit Matilda Maja Madeleine Britt Rebecka Agneta Sofie Pia Rut Yvonne Birgit Ann-Marie Inga Sonja Alice Mona Lina Louise Astrid Ann-Christin Ebba Klara Gunnel Erika Isabelle Britt-Marie Nathalie Moa Alexandra Viktoria Gerd Britta Ellen Irene Lisbeth Pernilla Maj Ella Wilma Felicia Charlotte Ingela Emilia)
    LAST_NAMES = %w(<NAME> <NAME>qvist <NAME> <NAME>vist <NAME>ström Lundström <NAME>ström <NAME>ström Åström Holmqvist Lindholm Sundqvist Ivarsson)

    task students: :environment do
      num = (ENV["num"] || 10).to_i
      1.upto(num) do
        student = FactoryGirl.create(:student, name: "#{FIRST_NAMES.sample} #{LAST_NAMES.sample}")
        puts "New student: #{student.name}"
      end
    end

    task suite: :environment do
      num = (ENV["evaluations"] || 2).to_i
      results = ENV["results"]

      suite = FactoryGirl.create(:suite, name: "Årsklocka #{DateTime.now.strftime("%Y%m%d%H%M")}")

      puts "New suite: #{suite.name}"

      1.upto(num) do |i|
        evaluation = FactoryGirl.create(:evaluation, name: "Test ##{i}", suite: suite)
        puts "New evaluation: #{evaluation.name}"
      end

      if results
        students = Student.order("random()").limit(10)

        suite.evaluations.each do |evaluation|
          puts "Results for #{evaluation.name}:"


          students.each do |student|
            result = rand(evaluation.max_result + 1)
            FactoryGirl.create(:result, value: result, student: student, evaluation: evaluation)
            puts "\t#{student.name}: #{result}"
          end
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.09498762376237624, 'fraction_numerical': 0.004022277227722772, 'mean_word_length': 3.8110119047619047, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '2321591', 'n_tokens_mistral': 1094, 'n_tokens_neox': 1022, 'n_words': 333}