Ejemplo n.º 1
0
        private List<Regex> GetExpressions(ITurnContext context, RegExLocaleMap map)
        {

            var locale = string.IsNullOrWhiteSpace(context.Activity.Locale) ? "*" : context.Activity.Locale;
            var entry = map.GetLocale(locale);
            return entry;
        }
Ejemplo n.º 2
0
        public RegExpRecognizerMiddleware AddIntent(string intentName, RegExLocaleMap map)
        {
            if (string.IsNullOrWhiteSpace(intentName))
                throw new ArgumentNullException("intentName");

            if (_intents.ContainsKey(intentName))
                throw new ArgumentException($"RegExpRecognizer: an intent name '{intentName}' already exists.");

            _intents[intentName] = map;

            return this;
        }