This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.xatkit.example; | |
| import com.xatkit.core.XatkitCore; | |
| import com.xatkit.plugins.react.platform.ReactPlatform; | |
| import com.xatkit.plugins.react.platform.io.ReactEventProvider; | |
| import com.xatkit.plugins.react.platform.io.ReactIntentProvider; | |
| import lombok.val; | |
| import org.apache.commons.configuration2.BaseConfiguration; | |
| import org.apache.commons.configuration2.Configuration; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on intent SentimentDemo from ReactPlatform do | |
| var sentiment = context.get("nlp")?.get("sentiment") as String | |
| if(sentiment.equals("Very negative")) { | |
| ReactPlatform.Reply("Ouch it hurts, sorry to disappoint you 😭") | |
| } else if(sentiment.equals("Negative")) { | |
| ReactPlatform.Reply("That's not really nice 😥") | |
| } else if(sentiment.equals("Neutral")) { | |
| ReactPlatform.Reply("That sentence felt pretty neutral to me, come on, don't be shy 😋") | |
| } else if(sentiment.equals("Positive")) { | |
| ReactPlatform.Reply("Ooh, thanks! That's very kind of you 🥰") |