/// <summary> /// Clear the state except for authentication information. /// </summary> public void ClearExceptAuth() { LuisResult = new PhoneLuis() { Text = string.Empty, AlteredText = string.Empty, Intents = new Dictionary <PhoneLuis.Intent, IntentScore>(), Entities = new PhoneLuis._Entities() { _instance = new PhoneLuis._Entities._Instance(), }, Properties = new Dictionary <string, object>(), }; ContactResult = new ContactSearchResult(); PhoneNumber = string.Empty; }
/// <summary> /// Override the entities on the state with the ones from the given LUIS result. /// </summary> /// <param name="state">The current state. This will be modified.</param> /// <param name="phoneResult">The LUIS result.</param> public void OverrideEntities(PhoneSkillState state, PhoneLuis phoneResult) { state.LuisResult.Entities.contactName = phoneResult.Entities.contactName; state.LuisResult.Entities._instance.contactName = phoneResult.Entities._instance.contactName; state.LuisResult.Entities.phoneNumber = phoneResult.Entities.phoneNumber; state.LuisResult.Entities._instance.phoneNumber = phoneResult.Entities._instance.phoneNumber; state.LuisResult.Entities.phoneNumberSpelledOut = phoneResult.Entities.phoneNumberSpelledOut; state.LuisResult.Entities._instance.phoneNumberSpelledOut = phoneResult.Entities._instance.phoneNumberSpelledOut; if (state.LuisResult.Entities.phoneNumberType == null || !state.LuisResult.Entities.phoneNumberType.Any() || (phoneResult.Entities.phoneNumberType != null && phoneResult.Entities.phoneNumberType.Any())) { state.LuisResult.Entities.phoneNumberType = phoneResult.Entities.phoneNumberType; state.LuisResult.Entities._instance.phoneNumberType = phoneResult.Entities._instance.phoneNumberType; } }