<commit_before>class WordGen::Generator

  attr_reader :word_length, :character_set, :writer

  def initialize word_length, character_set, writer = $stdout
    @word_length, @character_set, @writer = Integer(word_length), character_set.map(&:to_s), writer
  end

  def start
    printAllKLength character_set, word_length
  end

  private

  def printAllKLength char_set, k
    n = char_set.size
    printAllKLengthRec char_set, "", n, k
  end

  def printAllKLengthRec char_set, prefix, n, k
    if k == 0
      writer.puts prefix
      return
    end

    n.times do |i|
      new_prefix = prefix + char_set[i]
      printAllKLengthRec char_set, new_prefix, n, k - 1
    end
  end
end<commit_msg>remove unecessary code<commit_after>class WordGen::Generator

  attr_reader :word_length, :character_set, :writer

  def initialize word_length, character_set, writer = $stdout
    @word_length, @character_set, @writer = Integer(word_length), character_set.map(&:to_s), writer
  end

  def start
    printAllKLengthRec character_set, "", character_set.size, word_length
  end

  private

  def printAllKLengthRec char_set, prefix, n, k
    if k == 0
      writer.puts prefix
      return
    end

    n.times do |i|
      new_prefix = prefix + char_set[i]
      printAllKLengthRec char_set, new_prefix, n, k - 1
    end
  end
end
{'fraction_non_alphanumeric': 0.08063300678221552, 'fraction_numerical': 0.003014318010550113, 'mean_word_length': 3.4414715719063547, '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': '2611818', 'n_tokens_mistral': 453, 'n_tokens_neox': 435, 'n_words': 121}