<commit_before>require 'im/version'
require 'appscript'

module Im
  class << self

	def send_message(message, chat)
      puts chat
      puts "Sending '#{message}' to #{chat[:name]}"
      `osascript -e 'tell application "Messages" to send \"#{message}\" to item #{chat[:id].to_i} of text chats'`
	end

	def get_chat_list
      im = Appscript.app("Messages")
      participants = im.chats.participants.get()
      participants.map.with_index do |participant, index|
        { id: index+1, name: participant.first.name.get(), object: participant.first }
      end
	end

    def get_chat_from_number(chats, number)
      chats.select { |chat| chat[:id] == number.to_i }[0]
    end

  end
end<commit_msg>remove puts<commit_after>require 'im/version'
require 'appscript'

module Im
  class << self

	def send_message(message, chat)
      puts "Sending '#{message}' to #{chat[:name]}"
      `osascript -e 'tell application "Messages" to send \"#{message}\" to item #{chat[:id].to_i} of text chats'`
	end

	def get_chat_list
      im = Appscript.app("Messages")
      participants = im.chats.participants.get()
      participants.map.with_index do |participant, index|
        { id: index+1, name: participant.first.name.get(), object: participant.first }
      end
	end

    def get_chat_from_number(chats, number)
      chats.select { |chat| chat[:id] == number.to_i }[0]
    end

  end
end
{'fraction_non_alphanumeric': 0.13544668587896252, 'fraction_numerical': 0.002881844380403458, 'mean_word_length': 3.3679245283018866, 'pattern_counts': {'":': 0, '<': 7, '<?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': '697772', 'n_tokens_mistral': 470, 'n_tokens_neox': 466, 'n_words': 122}