/// <summary> /// Ctor /// </summary> /// <param name="bot">The bot involved in this request</param> /// <param name="user">The user making the request</param> /// <param name="query">The query that originated this node</param> /// <param name="request">The request inputted into the system</param> /// <param name="result">The result to be passed to the user</param> /// <param name="templateNode">The node to be processed</param> public sentence(KarmaloopAIMLBot.AIMLBot bot, KarmaloopAIMLBot.BotUser user, KarmaloopAIMLBot.Utils.SubQuery query, KarmaloopAIMLBot.Request request, KarmaloopAIMLBot.Result result, XmlNode templateNode) : base(bot, user, query, request, result, templateNode) { }
/// <summary> /// Ctor /// </summary> /// <param name="bot">The bot involved in this request</param> /// <param name="user">The user making the request</param> /// <param name="query">The query that originated this node</param> /// <param name="request">The request inputted into the system</param> /// <param name="result">The result to be passed to the user</param> /// <param name="templateNode">The node to be processed</param> public random(KarmaloopAIMLBot.AIMLBot bot, KarmaloopAIMLBot.BotUser user, KarmaloopAIMLBot.Utils.SubQuery query, KarmaloopAIMLBot.Request request, KarmaloopAIMLBot.Result result, XmlNode templateNode) : base(bot, user, query, request, result, templateNode) { this.isRecursive = false; }
/// <summary> /// Ctor /// </summary> /// <param name="bot">The bot involved in this request</param> /// <param name="user">The user making the request</param> /// <param name="query">The query that originated this node</param> /// <param name="request">The request itself</param> /// <param name="result">The result to be passed back to the user</param> /// <param name="templateNode">The node to be processed</param> public AIMLTagHandler(KarmaloopAIMLBot.AIMLBot bot, KarmaloopAIMLBot.BotUser user, KarmaloopAIMLBot.Utils.SubQuery query, KarmaloopAIMLBot.Request request, KarmaloopAIMLBot.Result result, XmlNode templateNode) : base(bot, templateNode.OuterXml) { this.user = user; this.query = query; this.request = request; this.result = result; this.templateNode = templateNode; this.templateNode.Attributes.RemoveNamedItem("xmlns"); }
/// <summary> /// Static helper that applies replacements from the passed dictionary object to the /// target string /// </summary> /// <param name="bot">The bot for whom this is being processed</param> /// <param name="dictionary">The dictionary containing the substitutions</param> /// <param name="target">the target string to which the substitutions are to be applied</param> /// <returns>The processed string</returns> public static string Substitute(KarmaloopAIMLBot.AIMLBot bot, KarmaloopAIMLBot.Utils.SettingsDictionary dictionary, string target) { string marker = ApplySubstitutions.getMarker(5); string result = target; foreach (string pattern in dictionary.SettingNames) { string p2 = ApplySubstitutions.makeRegexSafe(pattern); //string match = "\\b"[email protected]().Replace(" ","\\s*")+"\\b"; string match = "\\b" + p2.TrimEnd().TrimStart() + "\\b"; string replacement = marker + dictionary.GetSetting(pattern).Trim() + marker; result = Regex.Replace(result, match, replacement, RegexOptions.IgnoreCase); } return(result.Replace(marker, "")); }
/// <summary> /// Default ctor for used as part of late binding mechanism /// </summary> public TextTransformer() { this.bot = null; this.inputString = string.Empty; }
/// <summary> /// ctor /// </summary> /// <param name="bot">The bot this transformer is a part of</param> public TextTransformer(KarmaloopAIMLBot.AIMLBot bot) { this.bot = bot; this.inputString = string.Empty; }
/// <summary> /// ctor /// </summary> /// <param name="bot">The bot this transformer is a part of</param> /// <param name="inputString">The input string to be transformed</param> public TextTransformer(KarmaloopAIMLBot.AIMLBot bot, string inputString) { this.bot = bot; this.inputString = inputString; }
/// <summary> /// Ctor /// </summary> /// <param name="bot">The bot this sentence splitter is associated with</param> public SplitIntoSentences(KarmaloopAIMLBot.AIMLBot bot) { this.bot = bot; }
/// <summary> /// Ctor /// </summary> /// <param name="bot">The bot this sentence splitter is associated with</param> /// <param name="inputString">The raw input string to be processed</param> public SplitIntoSentences(KarmaloopAIMLBot.AIMLBot bot, string inputString) { this.bot = bot; this.inputString = inputString; }
public MakeCaseInsensitive(KarmaloopAIMLBot.AIMLBot bot) : base(bot) { }
public MakeCaseInsensitive(KarmaloopAIMLBot.AIMLBot bot, string inputString) : base(bot, inputString) { }
public StripIllegalCharacters(KarmaloopAIMLBot.AIMLBot bot) : base(bot) { }
public StripIllegalCharacters(KarmaloopAIMLBot.AIMLBot bot, string inputString) : base(bot, inputString) { }
/// <summary> /// Ctor /// </summary> /// <param name="bot">The bot whose brain is being processed</param> public AIMLLoader(KarmaloopAIMLBot.AIMLBot bot) { this.bot = bot; }
public ApplySubstitutions(KarmaloopAIMLBot.AIMLBot bot) : base(bot) { }
public ApplySubstitutions(KarmaloopAIMLBot.AIMLBot bot, string inputString) : base(bot, inputString) { }