<commit_before>class Rosalind
  def run args
    name = args.first.split(/[_.]/)[1]
    puts send("cmd_#{name}", parse(ARGF.read))
  end

  def parse s
    s.each_line.map { |l|
      case l
      when /^\s*#|^$/ then
        next
      else
        l.chomp
      end
    }.compact.join "\n"
  end

  def cmd_dna s
    count_dna(s).join " "<commit_msg>Made it work with multiple files<commit_after>class Rosalind
  def run args
    ARGV.each do |path|
      name = path.split(/[_.]/)[1]
      warn "# #{name}"
      puts send("cmd_#{name}", parse(File.read(path)))
    end
  end

  def parse s
    s.each_line.map { |l|
      case l
      when /^\s*#|^$/ then
        next
      else
        l.chomp
      end
    }.compact.join "\n"
  end

  def cmd_dna s
    count_dna(s).join " "
{'fraction_non_alphanumeric': 0.14578005115089515, 'fraction_numerical': 0.0025575447570332483, 'mean_word_length': 1.8267148014440433, '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': '2728999', 'n_tokens_mistral': 302, 'n_tokens_neox': 293, 'n_words': 75}