<commit_before># encoding: utf-8

module Axiom
  class Relation
    module Operation

      # A class representing a sorted relation
      class Order < Relation
        include Unary
        include Equalizer.new(:operand, :directions)

        # The relation sort order
        #
        # @return [Operation::Order::DirectionSet]
        #
        # @api private
        attr_reader :directions

        # Instantiate a new Order
        #
        # @example
        #   order = Order.new(operand, directions)
        #
        # @param [Relation] operand
        #   the relation to sort
        # @param [DirectionSet, Array<Direction, Attribute>] directions
        #   the directions to sort tuples in
        #
        # @return [Order]
        #
        # @api public
        def self.new(operand, directions)
          header     = operand.header
          directions = DirectionSet.coerce(directions) do |direction|
            header[direction] unless direction.kind_of?(Direction)
          end
          directions |= header - directions.attributes
          super<commit_msg>Add docs to include the header as an allowed argument to the constructor<commit_after># encoding: utf-8

module Axiom
  class Relation
    module Operation

      # A class representing a sorted relation
      class Order < Relation
        include Unary
        include Equalizer.new(:operand, :directions)

        # The relation sort order
        #
        # @return [Operation::Order::DirectionSet]
        #
        # @api private
        attr_reader :directions

        # Instantiate a new Order
        #
        # @example
        #   order = Order.new(operand, directions)
        #
        # @param [Relation] operand
        #   the relation to sort
        # @param [DirectionSet, Header, Array<Direction, Attribute>] directions
        #   the directions to sort tuples in
        #
        # @return [Order]
        #
        # @api public
        def self.new(operand, directions)
          header     = operand.header
          directions = DirectionSet.coerce(directions) do |direction|
            header[direction] unless direction.kind_of?(Direction)
          end
          directions |= header - directions.attributes
          super
{'fraction_non_alphanumeric': 0.07432131731197152, 'fraction_numerical': 0.0008900756564307966, 'mean_word_length': 1.882051282051282, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '7304233', 'n_tokens_mistral': 574, 'n_tokens_neox': 568, 'n_words': 172}