<commit_before>require 'exercism/curriculum/ruby'
require 'exercism/curriculum/javascript'
require 'exercism/curriculum/coffeescript'
require 'exercism/curriculum/elixir'
require 'exercism/curriculum/clojure'
require 'exercism/curriculum/go'
require 'exercism/curriculum/python'

class Exercism
  class UnknownLanguage < StandardError; end

  def self.current_curriculum
    return @curriculum if @curriculum

    @curriculum = Curriculum.new('./assignments')
    @curriculum.add RubyCurriculum.new
    @curriculum.add JavascriptCurriculum.new
    @curriculum.add ElixirCurriculum.new
    @curriculum.add ClojureCurriculum.new
    @curriculum.add PythonCurriculum.new
    @curriculum
  end

  def self.trails
    @trails ||= current_curriculum.trails.values
  end

  def self.languages
    @languages ||= current_curriculum.trails.keys.sort
  end
end

class Curriculum
  attr_reader :path, :trails, :locales
  def initialize(path)
    @path = path
    @locales = []
    @trails = {}
  end

  def add(curriculum)
    @trails[curriculum.locale.to_sym] = Trail.new(curriculum.locale, curriculum.slugs, path)
    @locales << curriculum.locale
  end

  def in(language)
    trails[language.to_sym]
  end

  def assign(exercise)
    self.in(exercise.language).assign(exercise.slug)
  end

  def identify_language(filename)
    ext = filename.gsub(/\A[^\.]+\./,  '')
    locale = locales.find {|lang| lang.code_extension == ext}
    if locale
      locale.language
    else
      raise Exercism::UnknownLanguage.new("Uknown language for file extension #{ext}")
    end
  end

  def unstarted_trails(started)
    available_languages - started
  end

  def available?(language)
    available_languages.include?(language)
  end

  private

  def available_languages
    locales.map(&:language)
  end

end<commit_msg>Fix typo<commit_after>require 'exercism/curriculum/ruby'
require 'exercism/curriculum/javascript'
require 'exercism/curriculum/coffeescript'
require 'exercism/curriculum/elixir'
require 'exercism/curriculum/clojure'
require 'exercism/curriculum/go'
require 'exercism/curriculum/python'

class Exercism
  class UnknownLanguage < StandardError; end

  def self.current_curriculum
    return @curriculum if @curriculum

    @curriculum = Curriculum.new('./assignments')
    @curriculum.add RubyCurriculum.new
    @curriculum.add JavascriptCurriculum.new
    @curriculum.add ElixirCurriculum.new
    @curriculum.add ClojureCurriculum.new
    @curriculum.add PythonCurriculum.new
    @curriculum
  end

  def self.trails
    @trails ||= current_curriculum.trails.values
  end

  def self.languages
    @languages ||= current_curriculum.trails.keys.sort
  end
end

class Curriculum
  attr_reader :path, :trails, :locales
  def initialize(path)
    @path = path
    @locales = []
    @trails = {}
  end

  def add(curriculum)
    @trails[curriculum.locale.to_sym] = Trail.new(curriculum.locale, curriculum.slugs, path)
    @locales << curriculum.locale
  end

  def in(language)
    trails[language.to_sym]
  end

  def assign(exercise)
    self.in(exercise.language).assign(exercise.slug)
  end

  def identify_language(filename)
    ext = filename.gsub(/\A[^\.]+\./,  '')
    locale = locales.find {|lang| lang.code_extension == ext}
    if locale
      locale.language
    else
      raise Exercism::UnknownLanguage.new("Unknown language for file extension #{ext}")
    end
  end

  def unstarted_trails(started)
    available_languages - started
  end

  def available?(language)
    available_languages.include?(language)
  end

  private

  def available_languages
    locales.map(&:language)
  end

end
{'fraction_non_alphanumeric': 0.1008869179600887, 'fraction_numerical': 0.0, 'mean_word_length': 3.8378016085790883, 'pattern_counts': {'":': 0, '<': 9, '<?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': '2981388', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1229, 'n_words': 236}