// This script provides a simple example of how to train your bot about things. State CategoryIdentification { pattern "[a an] * is [a an] *" template setCategory(); pattern "[a an] * is not [a an] *" template inverseCategory(); pattern "is [a an] * [a an] *" template checkCategory(); function setCategory() { var object = star[0]; var type = star[1]; object.type =+ type; return Template("Okay, I will remember that a {object} is a {type}."); } function inverseCategory() { var object = star[0]; var type = star[1]; object.type =- type; return Template("Okay, I will remember that a {object} is not a {type}."); } function checkCategory() { var object = star[0]; var type = star[1]; if (object.has(#type, type)) { return "Yes."; } else if (object.has(#type, type) == false) { return "No."; } else { return "I'm not sure."; } } }