<commit_before>require 'json'

class Settings
  attr_reader :data

  def initialize(data)
    @data = data
  end

  def self.build(filename)
    file_data = ::File.open(filename)

    data = JSON.load file_data

    new data
  end

  def get(*key)
  	key.flatten! if key.is_a? Array
  	key.inject(data) {|memo, k| memo[k] }
  end

  class File
    attr_accessor :directory

    def self.instance
      @instance ||= new<commit_msg>Pathname, rather than filename<commit_after>require 'json'

class Settings
  attr_reader :data

  def initialize(data)
    @data = data
  end

  def self.build(pathname)
    file_data = ::File.open(pathname)

    data = JSON.load file_data

    new data
  end

  def get(*key)
  	key.flatten! if key.is_a? Array
  	key.inject(data) {|memo, k| memo[k] }
  end

  class File
    attr_accessor :directory

    def self.instance
      @instance ||= new
{'fraction_non_alphanumeric': 0.1012514220705347, 'fraction_numerical': 0.0, 'mean_word_length': 2.893805309734513, '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': '1517844', 'n_tokens_mistral': 322, 'n_tokens_neox': 307, 'n_words': 82}