private List <Regex> GetExpressions(IBotContext context, RegExLocaleMap map) { string locale = string.IsNullOrWhiteSpace(((Activity)context.Request).Locale) ? "*" : ((Activity)context.Request).Locale; List <Regex> entry = map.GetLocale(locale); return(entry); }
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); }