<commit_before>module Subtle
  class Transform < Parslet::Transform
    rule(integer:    simple(:x)) { x.to_i }
    rule(float:      simple(:x)) { x.to_f }
    rule(array:     subtree(:x)) { x      }
    rule(function:  subtree(:x)) { x      }

    rule monad: { verb: simple(:verb), right: subtree(:right) } do
      { type: :monad, verb: verb.to_s, right: right }
    end

    rule monad: { verb: simple(:verb), adverb: simple(:adverb),
                  right: subtree(:right) } do
      { type: :monad, verb: verb.to_s, adverb: adverb.to_s, right: right }
    end

    rule dyad: { left: subtree(:left), verb: simple(:verb),
                 right: subtree(:right) } do
      { type: :dyad, left: left, verb: verb.to_s, right: right }
    end

    rule dyad: { left: subtree(:left), verb: simple(:verb),
                 adverb: simple(:adverb), right: subtree(:right) } do
      { type: :dyad, left: left, verb: verb.to_s, adverb: adverb, right: right }
    end

    rule enumerate: { last: subtree(:last) } do
      { type: :enumerate, last: last }
    end

    rule assignment: { identifier: simple(:identifier),
                       right: subtree(:right) } do
      { type: :assignment, identifier: identifier.to_s, right: right }
    end

    rule deassignment: { identifier: simple(:identifier) } do
      { type: :deassignment, identifier: identifier.to_s }
    end

    rule function_call: { function: subtree(:function),
                          right: subtree(:right) } do
      { type: :function_call, function: function, right: right }
    end
  end
end<commit_msg>Forgot to convert adverb to a String from Parslet::Slice in one place.<commit_after>module Subtle
  class Transform < Parslet::Transform
    rule(integer:    simple(:x)) { x.to_i }
    rule(float:      simple(:x)) { x.to_f }
    rule(array:     subtree(:x)) { x      }
    rule(function:  subtree(:x)) { x      }

    rule monad: { verb: simple(:verb), right: subtree(:right) } do
      { type: :monad, verb: verb.to_s, right: right }
    end

    rule monad: { verb: simple(:verb), adverb: simple(:adverb),
                  right: subtree(:right) } do
      { type: :monad, verb: verb.to_s, adverb: adverb.to_s, right: right }
    end

    rule dyad: { left: subtree(:left), verb: simple(:verb),
                 right: subtree(:right) } do
      { type: :dyad, left: left, verb: verb.to_s, right: right }
    end

    rule dyad: { left: subtree(:left), verb: simple(:verb),
                 adverb: simple(:adverb), right: subtree(:right) } do
      { type: :dyad, left: left, verb: verb.to_s, adverb: adverb.to_s,
        right: right }
    end

    rule enumerate: { last: subtree(:last) } do
      { type: :enumerate, last: last }
    end

    rule assignment: { identifier: simple(:identifier),
                       right: subtree(:right) } do
      { type: :assignment, identifier: identifier.to_s, right: right }
    end

    rule deassignment: { identifier: simple(:identifier) } do
      { type: :deassignment, identifier: identifier.to_s }
    end

    rule function_call: { function: subtree(:function),
                          right: subtree(:right) } do
      { type: :function_call, function: function, right: right }
    end
  end
end
{'fraction_non_alphanumeric': 0.13765432098765432, 'fraction_numerical': 0.0, 'mean_word_length': 2.5, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7022719', 'n_tokens_mistral': 1046, 'n_tokens_neox': 1022, 'n_words': 288}