<commit_before># Copyright 2010 ThoughtWorks, Inc. Licensed under the MIT License
module Cuporter
  module Formatters
    module TextMethods
    
      def write(number_scenarios)
        @report.children.each do |tag_node|
          tag_node.number_all_descendants if number_scenarios
          write_node(tag_node, 0)
        end
      end

      def write_node(node, tab_stops)
        @output.puts "#{self.class::TAB * tab_stops}#{node.name}"
        node.children.each do |child|
          @output.puts "#{self.class::TAB + (self.class::TAB * tab_stops)}#{child.name}"
          child.children.each do |grand_child|
            if grand_child.has_children?
              write_node(grand_child, tab_stops + 2)
            else
              @output.puts "#{self.class::TAB * tab_stops}#{self.class::TAB * 2}#{grand_child.name}"
            end
          end
        end
      end
    
    end
  end
end<commit_msg>simplified text write_node()<commit_after># Copyright 2010 ThoughtWorks, Inc. Licensed under the MIT License
module Cuporter
  module Formatters
    module TextMethods
    
      def write(number_scenarios)
        @report.children.each do |tag_node|
          tag_node.number_all_descendants if number_scenarios
          write_node(tag_node, 0)
        end
      end

      def write_node(node, tab_stops)
        @output.puts "#{self.class::TAB * tab_stops}#{node.name}"
        node.children.each do |child|
          if child.has_children?
            write_node(child, tab_stops + 1)
          else
            @output.puts "#{self.class::TAB * tab_stops}#{self.class::TAB }#{child.name}"
          end
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09598080383923216, 'fraction_numerical': 0.007798440311937612, 'mean_word_length': 2.238834951456311, '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': '2219728', 'n_tokens_mistral': 541, 'n_tokens_neox': 519, 'n_words': 115}