<commit_before>require "gakkacho/version"
require "yaml"

module Gakkacho
  YAML.load_file("./lib/universities.yml").each do |univ, univ_dirname|
    university_path = "./lib/universities/#{univ_dirname}"
    YAML.load_file(university_path + "/departments.yml").each do |dept, dept_dirname|
      department_path = university_path+ "/" + dept_dirname
      YAML.load_file(department_path + "/courses.yml").each do |cour, cour_filename|
        @@subjects                 ||= {}
        @@subjects[univ]           ||= {}
        @@subjects[univ][dept]     ||= {}
        @@subjects[univ][dept][cour] = YAML.load_file(department_path + "/#{cour_filename}.yml")
      end
    end
  end

  def all_universities
    @@subjects.map{ |k, v| k }
  end

  def all_departments_in univ
    @@subjects[univ].map{ |k ,v| k }
  end
<commit_msg>fix load path<commit_after>require "gakkacho/version"
require "yaml"

module Gakkacho
  BASE_PATH = "./lib/gakkacho"
  YAML.load_file("#{BASE_PATH}/universities.yml").each do |univ, univ_dirname|
    university_path = "#{BASE_PATH}/universities/#{univ_dirname}"
    YAML.load_file(university_path + "/departments.yml").each do |dept, dept_dirname|
      department_path = university_path+ "/" + dept_dirname
      YAML.load_file(department_path + "/courses.yml").each do |cour, cour_filename|
        @@subjects                 ||= {}
        @@subjects[univ]           ||= {}
        @@subjects[univ][dept]     ||= {}
        @@subjects[univ][dept][cour] = YAML.load_file(department_path + "/#{cour_filename}.yml")
      end
    end
  end

  def all_universities
    @@subjects.map{ |k, v| k }
  end

  def all_departments_in univ
    @@subjects[univ].map{ |k ,v| k }
  end

{'fraction_non_alphanumeric': 0.15249266862170088, 'fraction_numerical': 0.0, 'mean_word_length': 3.091127098321343, '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': '2705954', 'n_tokens_mistral': 658, 'n_tokens_neox': 618, 'n_words': 102}