<commit_before># The Message class and its subclasses, each used for holding one line of a
# chat.

module Pidgin2Adium
  # A holding object for each line of the chat. It is subclassed as
  # appropriate (eg AutoReplyMessage). Each subclass (but not Message
  # itself) has its own to_s which prints out its information in a format
  # appropriate for putting in an Adium log file.
  # Subclasses: XMLMessage, AutoReplyMessage, StatusMessage, Event.
  class Message
    include Comparable
    def initialize(sender, time, buddy_alias)
      # The sender's screen name
      @sender = sender
      # The time the message was sent, in Adium format (e.g.
      # "2008-10-05T22:26:20-0800")
      @time = time
      @time_object = Time.parse(@time)
      # The receiver's alias (NOT screen name)
      @buddy_alias = buddy_alias
    end
    attr_accessor :sender, :time, :buddy_alias

    # Compare this Message to +other_message+, based on their timestamps.
    def <=>(other_message)
      return @time_object - other_message.time_object
    end

    protected
      # Protected because Time.parse doesn't have exactly the right time
      # zone. It works fine for <=>, though.
      def time_object
        return @time_object
      end
  end
end<commit_msg>Add doc for Message#<=><commit_after># The Message class and its subclasses, each used for holding one line of a
# chat.

module Pidgin2Adium
  # A holding object for each line of the chat. It is subclassed as
  # appropriate (eg AutoReplyMessage). Each subclass (but not Message
  # itself) has its own to_s which prints out its information in a format
  # appropriate for putting in an Adium log file.
  # Subclasses: XMLMessage, AutoReplyMessage, StatusMessage, Event.
  class Message
    include Comparable
    def initialize(sender, time, buddy_alias)
      # The sender's screen name
      @sender = sender
      # The time the message was sent, in Adium format (e.g.
      # "2008-10-05T22:26:20-0800")
      @time = time
      @time_object = Time.parse(@time)
      # The receiver's alias (NOT screen name)
      @buddy_alias = buddy_alias
    end
    attr_accessor :sender, :time, :buddy_alias

    # Compare this Message to +other_message+, based on their timestamps.
    # Returns a number < 0 if this message was sent before +other_message+,
    # 0 if they were sent at the same time, and a number > 0 if this message
    # was sent after +other_message+.
    def <=>(other_message)
      return @time_object - other_message.time_object
    end

    protected
      # Protected because Time.parse doesn't have exactly the right time
      # zone. It works fine for <=>, though.
      def time_object
        return @time_object
      end
  end
end
{'fraction_non_alphanumeric': 0.07134976094152262, 'fraction_numerical': 0.015079073188672305, 'mean_word_length': 2.9824304538799415, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3935740', 'n_tokens_mistral': 816, 'n_tokens_neox': 770, 'n_words': 323}