<commit_before><commit_msg>Add lookslike script<commit_after># Description:
#   hubot に誰かが何に似てるか教えたり聞いたりする
#
# Commands:
#   hubot xxx looks like keyword
#   hubot who does xxx look like?
#   hubot xxx does not look like anyone

module.exports = (robot) ->

  robot.respond /([a-z0-9]+) looks like (.+)/i, (msg) ->
    user_name = msg.match[1]
    what = msg.match[2]
    room = msg.message.room
    msg.query = what
    robot.brain.data.lookslike = {} unless robot.brain.data.lookslike
    robot.brain.data.lookslike[user_name] = what
    robot.brain.save
    msg.send "OK. #{user_name} looks like #{what}"
    robot.emit "image:get", msg, room
  robot.respond /who does ([a-z0-9]+) look like\??/i, (msg) ->
    user_name = msg.match[1]
    if robot.brain.data.lookslike[user_name]
      what = robot.brain.data.lookslike[user_name]
      room = msg.message.room
      msg.query = what
      msg.send "#{user_name} looks like *#{what}*"
      robot.emit "image:get", msg, room
    else
      msg.send "I don't know who does #{user_name} looks like..."
  robot.respond /([a-z0-9]+) does not look like anyone/i, (msg) ->
    user_name = msg.match[1]
    delete robot.brain.data.lookslike[user_name]
    msg.send "OK. #{user_name} has Absolutely Unique Face!!!"

{'fraction_non_alphanumeric': 0.14761904761904762, 'fraction_numerical': 0.007936507936507936, 'mean_word_length': 3.054662379421222, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '482175', 'n_tokens_mistral': 481, 'n_tokens_neox': 472, 'n_words': 112}