public virtual bool ParseIntent(CUIContext context, DateTime time, string input) { var intent = NLUEngine.GetIntent(input); if (Controller.DebugEnabled) { DebugIntent(intent); } if (!intent.IsNone && intent.Top.Label == "menu" && intent.Top.Score > 0.7) { Menu(intent); } if (intent.Top.Score < 0.8) { return(false); } else { if (Intents.ContainsKey(intent.Top.Label)) { DispatchIntent(intent, Intents[intent.Top.Label]); } else { SayErrorLine("This package recognizes intent {0} but does not have handler for it.", intent.Top.Label); DebugIntent(intent); } return(true); } }
internal void AddIntent(MatchIntentAndEntities intent, DialogVariablesSimulator dialogVariables) { if (!Intents.ContainsKey(intent.Name)) { Intents.Add(intent.Name, intent); dialogVariables.AddMatchIntentAndEntities(intent); } else { var otherIntent = Intents[intent.Name]; LogMessage(intent.LineNumber, MessageType.DuplicateKey, "Two intent matching nodes found for intent \"" + intent.Name + "\" : line " + intent.LineNumber + " and line " + otherIntent.LineNumber); } }