 #   None
 #
 # Commands:
-#   None
+#   stemming <words> - how would natural factoid stem a set of words?
 #
 # Notes:
 #   None

  contained.length == keywords.length

module.exports = (robot) ->
  robot.hear /(.*)\?$/i, (msg) ->
    stems = FTStemmer.tokenizeAndStem(msg.match[1])
    stems.unshift msg.message.user.room.replace(/@.*/,'')
    result = (k for k in factoidkeys when compare(stems,k))
    if result[0]
      robot.receive new TextMessage(msg.message.user, "~#{result[0]}")

# Author:
#   ivey

TextMessage = require('hubot').TextMessage
FTNatural = require('natural')
FTStemmer = FTNatural.PorterStemmer

factoidkeys = [
  ['merlinsupport', ['merlin', 'who', 'support']],
  ['chefsupport', ['chef', 'who', 'support']]
]

compare = (tokens, factoidkey) ->
