public static MockLuisRecognizer CreateRecognizer()
        {
            var recognizer = new MockLuisRecognizer(defaultIntent: CreateIntent(string.Empty, Integrate_Composer_Dialog_Using_SkillLuis.Intent.None));

            recognizer.RegisterUtterances(_utterances);
            return(recognizer);
        }
        public static MockLuisRecognizer CreateRecognizer()
        {
            var recognizer = new MockLuisRecognizer(defaultIntent: CreateIntent(string.Empty, GeneralLuis.Intent.None));

            recognizer.RegisterUtterances(_utterances);
            return(recognizer);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Finish building the MockLuisRecognizer. This also resets the internal state of this builder, so it can be reused to build another MockLuisRecognizer.
        /// </summary>
        /// <returns>The built MockLuisRecognizer.</returns>
        public MockLuisRecognizer Build()
        {
            var intentType   = typeof(TIntent);
            var intentValues = intentType.GetEnumValues();
            var intentNames  = intentType.GetEnumNames();

            for (int i = 0; i < intentValues.Length; ++i)
            {
                if ("None".Equals(intentNames[i]))
                {
                    var noneIntent = (TIntent)intentValues.GetValue(i);
                    var recognizer = new MockLuisRecognizer(defaultIntent: CreateIntent(string.Empty, noneIntent));
                    recognizer.RegisterUtterances(utterances);

                    Reset();

                    return(recognizer);
                }
            }

            throw new Exception($"Cannot find enum value {intentType.FullName}.None.");
        }