<commit_before># -*- encoding : utf-8 -*-

module Linael

  # mains methods of IRC
  module IRC

    def self.linael_start
      self.connect(Linael::Server,Linael::Port,Linael::Nick)
      action = Handler.new(Linael::MasterModule,Linael::ModulesToLoad)
      self.main_loop(action)
    end

    # Send a message in the socket
    def self.send_msg(msg)
      $linael_irc_socket.puts "#{msg}\n"
    end

    # Connect to a server
    def self.connect(server,port,nick)
      $linael_irc_socket = TCPSocket.open(server, port)
      send_msg "USER #{nick} 0 * :Linael"
      send_msg "NICK #{nick}"
    end

    # Main loop of the irc to keep the prog reading inside the socket
    def self.main_loop(msg_handler)
      while line = get_msg
        p line
        msg_handler.handle_msg(line)
      end
    end

    #read from socket<commit_msg>removing printing of lines<commit_after># -*- encoding : utf-8 -*-

module Linael

  # mains methods of IRC
  module IRC

    def self.linael_start
      self.connect(Linael::Server,Linael::Port,Linael::Nick)
      action = Handler.new(Linael::MasterModule,Linael::ModulesToLoad)
      self.main_loop(action)
    end

    # Send a message in the socket
    def self.send_msg(msg)
      $linael_irc_socket.puts "#{msg}\n"
    end

    # Connect to a server
    def self.connect(server,port,nick)
      $linael_irc_socket = TCPSocket.open(server, port)
      send_msg "USER #{nick} 0 * :Linael"
      send_msg "NICK #{nick}"
    end

    # Main loop of the irc to keep the prog reading inside the socket
    def self.main_loop(msg_handler)
      while line = get_msg
        msg_handler.handle_msg(line)
      end
    end

    #read from socket
{'fraction_non_alphanumeric': 0.09727164887307237, 'fraction_numerical': 0.002372479240806643, 'mean_word_length': 2.7488888888888887, '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': '4345768', 'n_tokens_mistral': 595, 'n_tokens_neox': 568, 'n_words': 146}