<commit_before># This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
#   Mayor.create(name: 'Emanuel', city: cities.first)<commit_msg>create db/seeds.rb file for languages, levels, topics, and users<commit_after>require 'faker'

LANGUAGES = [
            {name: "English", code: "en", img_url: Faker::Avatar.image},
            {name: "Spanish", code: "es", img_url: Faker::Avatar.image}]

LEVELS = [
  {name: "beginner", value: 1},
  {name: "intermediate beginner", value: 2},
  {name: "advanced beginner", value: 3},
  {name: "low intermediate", value: 4},
  {name: "mid intermediate", value: 5},
  {name: "advanced intermediate", value: 6},
  {name: "low advanced", value: 7},
  {name: "mid advanced", value: 8},
  {name: "high advanced", value: 9},
  {name: "expert", value: 10}
]

BEGINNER_TOPICS = [
  "Introduce Yourself",
  "How is the weather?",
  "Who are your family members?",
  "Where do you live?",
  "What is your favorite food?"
]

MID_BEGINNER_TOPICS = [
  "Tell me about a sport that you like",
  "What is your favorite holiday?",
  "What type of pets have you had in the past?",
  "Tell me about your mother and father",
  "Tell me about the school that you attended"
]

ADVANCED_BEGINNER_TOPICS = [
  "Tell me about your favorite movie",
  "Tell me about a place you would like to visit",
  "Tell me about your favorite band",
  "Tell me about your best friend",
  "Tell me about your daily routine"
]

LOW_INTERMEDIATE_TOPICS = [
  "Tell me about a time when you were really afraid",
  "Tell me about a time when you were really happy",
  "Tell me about an accomplishment of yours",
  "Tell me about your daily routine at work",
  "Tell me about a meal that you like to cook"
]

MID_INTERMEDIATE_TOPICS = [
  "Tell me about the last book that you read",
  "Explain to me the plot of the last movie you saw",
  "Who is your favorite artist and why?",
  "Who is someone you look up to?",
  "What is your idea of a perfect day?"
]

ADVANCED_INTERMEDIATE_TOPICS = [
  "What would you change in your country if you were President?",
  "What is one of your earliest memories?",
  "What is your favorite TV show? Why?",
  "What does your family do every year for the holidays?",
  "Tell me about a challenge you faced recently at work."
]

LOW_ADVANCED_TOPICS = [
  "Tell me about a time when you overcame adversity",
  "Tell me what you look for in a good friend",
  "Tell me what values you consider to be most important",
  "Tell me about your views on politics",
  "Tell me about your views on religion"
]

MID_ADVANCED_TOPICS = [
  "Tell me what you think is the best way to learn something new",
  "Tell me what you feel is the best way to deal with stress",
  "Tell me how you deal with situations that make you angry",
  "Tell me what you think a perfect vacation would be",
  "Tell me what you do to relax"
]

HIGH_ADVANCED_TOPICS = [
  "Tell me what you feel are the flaws in the political system in your country",
  "How do you feel about the saying, 'it is better to spare an individual than a village'. Why do you feel that way?",
  "What do you think would be a solution to conflict in the world? Why are wars fought?",
  "How much of success do you think depends on luck, and how much on skill?",
  "How do you feel about the growth of technology? What dangers do you think it might have?"
]

EXPERT_TOPICS = [
  "Take me step by step through your best recipe",
  "Explain to me in detail the plot of a movie",
  "Tell me in detail about your family and how they have shaped your personality",
  "Tell me about a hobby you have describe what it feels like to you",
  "Pick a political topic and discuss the arguments for and against it"
]


TOPICS = [
    BEGINNER_TOPICS,
    MID_BEGINNER_TOPICS,
    ADVANCED_BEGINNER_TOPICS,
    LOW_INTERMEDIATE_TOPICS,
    MID_INTERMEDIATE_TOPICS,
    ADVANCED_INTERMEDIATE_TOPICS,
    LOW_ADVANCED_TOPICS,
    MID_ADVANCED_TOPICS,
    HIGH_ADVANCED_TOPICS,
    EXPERT_TOPICS
]

LANGUAGES.each do |language|
  new_language = Language.create(name: language[:name], code: language[:code], img_url: language[:img_url])
  # p new_language.name
  LEVELS.each_with_index do |level, idx|
    new_level = Level.create(name: level[:name], value: level[:value], language_id: new_language.id)
    # p new_level.name
    TOPICS[idx].each do |topic|
      new_topic = Topic.create(name: topic, level_id: new_level.id, language_id: new_language.id)
      # p new_topic.name
    end
  end
end

Language.all.each_with_index do |language, idx|
  study_language = Language.all[idx -1]
  p study_language.name
  50.times do
    user = User.create(
    native_language_id: language.id,
    study_language_id: study_language.id,
    level_id: study_language.levels.first.id,
    country_id: Country.create(name: Faker::Address.country, image_url: Faker::Avatar.image).id,
    username: Faker::Name.name,
    email: Faker::Internet.email,
    password: "password")
  end
end
{'fraction_non_alphanumeric': 0.09565386107877377, 'fraction_numerical': 0.002716336825766395, 'mean_word_length': 3.890891840607211, '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': '1395318', 'n_tokens_mistral': 1680, 'n_tokens_neox': 1620, 'n_words': 677}