<commit_before>module Alf
  module Lang
    module ObjectOriented
      module RenderingMethods

        def self.def_renderer_method(name, clazz)
          define_method(:"to_#{name}") do |*args|
            options, io = nil
            args.each do |arg|
              options ||= arg if arg.is_a?(Hash)
              io      ||= arg if arg.respond_to?(:<<)
            end
            to_array(options || {}) do |arr|
              io ||= ""
              clazz.new(arr, options).execute(io)
              io
            end
          end
        end

        def to_array(options = {})
          _with_ordering(options) do |o|
            op = Alf::Engine::ToArray.new(to_cog, o)
            block_given? ? yield(op) : op.to_a
          end
        end

        def to_a(options = nil)
          options.nil? ? super() : to_array(options)
        end
<commit_msg>Fix Relvar::Virtual#to_a<commit_after>module Alf
  module Lang
    module ObjectOriented
      module RenderingMethods

        def self.def_renderer_method(name, clazz)
          define_method(:"to_#{name}") do |*args|
            options, io = nil
            args.each do |arg|
              options ||= arg if arg.is_a?(Hash)
              io      ||= arg if arg.respond_to?(:<<)
            end
            to_array(options || {}) do |arr|
              io ||= ""
              clazz.new(arr, options).execute(io)
              io
            end
          end
        end

        def to_array(options = {})
          _with_ordering(options) do |o|
            op = Alf::Engine::ToArray.new(to_cog, o)
            block_given? ? yield(op) : op.to_a
          end
        end

        def to_a(options = nil)
          (options.nil? && defined?(super)) ? super() : to_array(options || {})
        end

{'fraction_non_alphanumeric': 0.11499436302142052, 'fraction_numerical': 0.0, 'mean_word_length': 1.479050279329609, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6192927', 'n_tokens_mistral': 536, 'n_tokens_neox': 541, 'n_words': 120}