private bool PasstCategory(WissensCategory category, string eingabe, string that, ArrayList vorherigeSRAIs, out AntwortSatz antwort) { PatternMatcher patternMatcher = new PatternMatcher(category.That.RegExObjekt, that); if (patternMatcher.Erfolgreich) { PatternMatcher patternMatcher2 = new PatternMatcher(category.Pattern.RegExObjekt, eingabe); if (patternMatcher2.Erfolgreich) { this._session.Denkprotokoll.Add(new BotDenkProtokollSchritt(string.Format(ResReader.Reader(this._session.DenkprotokollKultur).GetString("PassendeKategorieGefunden", this._session.DenkprotokollKultur)), BotDenkProtokollSchritt.SchrittArten.PassendeKategorieGefunden, category)); AntwortSatz antwortSatz = this.InterpretiereCategory_(category, patternMatcher2, patternMatcher, that, vorherigeSRAIs); if (antwortSatz.IstNotfallAntwort) { antwort = antwortSatz; } else if (category.Pattern.Inhalt == "*" && category.That.Inhalt == "*") { antwort = new AntwortSatz(antwortSatz.Satz, true); } else { antwort = new AntwortSatz(antwortSatz.Satz, false); } return(true); } } antwort = null; return(false); }
private AntwortSatz InterpretiereCategory_(WissensCategory category, PatternMatcher patternMatch, PatternMatcher thatMatch, string that, ArrayList vorherigeSRAIs) { StringBuilder stringBuilder = new StringBuilder(); bool istNotfallAntwort = true; XmlNode xmlNode = category.CategoryNode.SelectSingleNode("template"); if (xmlNode != null) { foreach (XmlNode childNode in xmlNode.ChildNodes) { if (childNode is XmlText) { stringBuilder.Append(childNode.InnerText); istNotfallAntwort = false; } else { bool flag = default(bool); string ausgabeDiesesTags = this.GetAusgabeDiesesTags((long)stringBuilder.Length, childNode, patternMatch, thatMatch, that, out flag, vorherigeSRAIs); if (!flag) { istNotfallAntwort = false; } stringBuilder.Append(ausgabeDiesesTags); } } return(new AntwortSatz(stringBuilder.ToString(), istNotfallAntwort)); } return(new AntwortSatz("Error: NO TEMPLATE-NODE FOUND", true)); }
public void CategoryAufnehmen(WissensCategory category) { this._categories.Add(category); if (category.Pattern.Inhalt == "*") { this._starCategories.Add(category); } this.FlushSortierungen(); }
public void CategoryAufnehmen(WissensCategory category) { WissenThema wissenThema = (WissenThema)this._themen[(object)category.ThemaName]; if (wissenThema == null) { wissenThema = new WissenThema(category.ThemaName); this._themen.Add((object)category.ThemaName, (object)wissenThema); } wissenThema.CategoryAufnehmen(category); }
private void CategoryVerarbeiten(XmlNode categoryNode, string themaName, string aimlDateiname, GaitoBotEigenschaften botEigenschaften) { WissensCategory category = new WissensCategory(this._normalisierung, categoryNode, themaName, aimlDateiname, botEigenschaften); this._wissen.CategoryAufnehmen(category); }