<commit_before>class Puzzle
  def initialize
    # TEST CASES
    test_cases.each do |input, expected|
      test(input, expected)
    end
    puts "-"*50, ""
    # SOLVE
    puts "Solution:", solve(read_input)
  end

  def read_input(file: "input", strip: true) # Only works when called from dir with solutions
    input = File.readlines(File.expand_path(file))
    input = input.map(&:strip) if strip<commit_msg>Make it easier to run puzzles from other dirs<commit_after>class Puzzle
  def initialize
    test_cases.each do |input, expected|
      test(input, expected)
    end
    puts "-"*50, ""
    puts "Solution:", solve(read_input)
  end

  def read_input(file: "input", strip: true) # Only works when called from dir with solutions
    input = File.readlines(File.expand_path(file, File.dirname($0)))
    input = input.map(&:strip) if strip
{'fraction_non_alphanumeric': 0.11189634864546526, 'fraction_numerical': 0.005889281507656066, 'mean_word_length': 3.5698924731182795, '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': '4574378', 'n_tokens_mistral': 274, 'n_tokens_neox': 266, 'n_words': 83}