示例#1
0
 /// <summary>
 /// The method that does the actual Processing of the text.
 /// </summary>
 /// <returns>The resulting Processed text</returns>
 protected override Unifiable ProcessChangeU()
 {
     if (CheckNode("cycphrase"))
     {
         return(TheCyc.Paraphrase(TransformAtomically(null, false)));
     }
     return(Unifiable.Empty);
 }
示例#2
0
 protected override Unifiable ProcessChangeU()
 {
     if (CheckNode("cycassert"))
     {
         string sent = templateNodeInnerText = ((AIMLTagHandler)this).Recurse();
         if (IsValue(sent))
         {
             string mt = TheCyc.Cyclify(GetAttribValue("mt", Proc.GetUserMt(user, query)));
             return(TheCyc.EvalSubL(
                        SafeFormat("(eval (subseq `(cyc-assert '{0} {1} ) 0 3) )", sent, mt), null));
         }
     }
     return(Unifiable.Empty);
 }
示例#3
0
 protected override Unifiable ProcessChangeU()
 {
     if (templateNode.Name.ToLower() == "cycrandom")
     {
         Unifiable filter = base.GetAttribValue("filter", null);
         if (!IsNullOrEmpty(templateNodeInnerText))
         {
             return
                 (TheCyc.EvalSubL(
                      String.Format(
                          "(clet ((list {0})) (nth (random (length list)) list))",
                          ((AIMLTagHandler)this).Recurse()), filter));
         }
     }
     return(Unifiable.Empty);
 }
示例#4
0
 protected override Unifiable ProcessChangeU()
 {
     if (templateNode.Name.ToLower() == "cycsystem")
     {
         Unifiable filter = base.GetAttribValue("filter", null);
         if (!IsNullOrEmpty(templateNodeInnerText))
         {
             if (WhenTrue(TheCyc.EvalSubL(((AIMLTagHandler)this).Recurse(), filter)))
             {
                 base.Succeed();
                 return(templateNodeInnerText);
             }
         }
     }
     return(Unifiable.Empty);
 }
示例#5
0
 protected override Unifiable ProcessChangeU()
 {
     if (CheckNode("cycquery"))
     {
         Unifiable filter  = GetAttribValue("filter", null);
         Unifiable varname = base.GetAttribValue("varname", "?REPLY");
         String    sent    = ((AIMLTagHandler)this).Recurse();
         string    mt      = TheCyc.Cyclify(GetAttribValue("mt", /*Proc.GetUserMt(user)*/ "#$EverythingPSC"));
         if (!IsEMPTY(sent))
         {
             if (WhenTrue(TheCyc.EvalSubL(String.Format("(ask-template '{0} `{1} {2})", varname, sent, mt), filter)))
             {
                 Succeed();
                 return(FinalResult);
             }
         }
     }
     return(Unifiable.Empty);
 }