<commit_before># This allows commands to be run in a shell-ish pipeline. The first
# command is run and text of its response (if any) is fed as the final
# argument(s) to the next command and so on. The result of the pipeline
# must be a message or the entire thing is ignored.
Basil.respond_to(/\|/) {

  reply    = nil
  commands = @msg.text.split('|').map(&:strip)

  while command = commands.shift
    if reply
      from      = reply.from
      from_name = reply.from_name
      text      = "#{command} #{reply.text}"
    else
      from      = @msg.from
      from_name = @msg.from_name
      text      = command
    end

    reply = Basil.dispatch(Basil::Message.new(Basil::Config.me, from, from_name, text))
  end

  reply if reply

}<commit_msg>respect original from in piped commands<commit_after># This allows commands to be run in a shell-ish pipeline. The first
# command is run and text of its response (if any) is fed as the final
# argument(s) to the next command and so on. The result of the pipeline
# must be a message or the entire thing is ignored.
Basil.respond_to(/\|/) {

  reply    = nil
  commands = @msg.text.split('|').map(&:strip)

  while command = commands.shift
    text  = reply ? "#{command} #{reply.text}" : command
    reply = Basil.dispatch(Basil::Message.new(Basil::Config.me, @msg.from, @msg.from_name, text, @msg.chat))
  end

  reply if reply

}
{'fraction_non_alphanumeric': 0.10966810966810966, 'fraction_numerical': 0.0, 'mean_word_length': 3.020289855072464, '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': '6494824', 'n_tokens_mistral': 435, 'n_tokens_neox': 422, 'n_words': 164}