<commit_before>module Veritas
  class Relation
    include Enumerable

    attr_reader :header, :body

    def initialize(header, body)
      @header, @body = header, body
    end

    def each(&block)
      body.each(&block)
      self
    end

    def union(other)
      Algebra::Union.new(self, other)
    end

    alias | union

    def intersect(other)
      Algebra::Intersection.new(self, other)
    end

    alias & intersect

    def difference(other)
      Algebra::Difference.new(self, other)
    end

    alias - difference

    def product(other)
      Algebra::Product.new(self, other)
    end

    alias * product

    def join(other)
      Algebra::Join.new(self, other)
    end

    alias + join

    def ==(other)
      header == other.header &&
      body   == other.body
    end<commit_msg>Groupped similar operations together in Relation<commit_after>module Veritas
  class Relation
    include Enumerable

    attr_reader :header, :body

    def initialize(header, body)
      @header, @body = header, body
    end

    def each(&block)
      body.each(&block)
      self
    end

    def join(other)
      Algebra::Join.new(self, other)
    end

    alias + join

    def product(other)
      Algebra::Product.new(self, other)
    end

    alias * product

    def intersect(other)
      Algebra::Intersection.new(self, other)
    end

    alias & intersect

    def union(other)
      Algebra::Union.new(self, other)
    end

    alias | union

    def difference(other)
      Algebra::Difference.new(self, other)
    end

    alias - difference

    def ==(other)
      header == other.header &&
      body   == other.body
    end
{'fraction_non_alphanumeric': 0.09425981873111783, 'fraction_numerical': 0.0, 'mean_word_length': 2.2598425196850394, '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': '3271853', 'n_tokens_mistral': 529, 'n_tokens_neox': 494, 'n_words': 132}