Ejemplo n.º 1
0
 public evidence_assoc(AltBot bot,
                       User user,
                       SubQuery query,
                       Request request,
                       Result result,
                       XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
 }
Ejemplo n.º 2
0
 /// <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 UnifibleTagHandler(AltBot bot,
                           User user,
                           SubQuery query,
                           Request request,
                           Result result,
                           XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
 }
Ejemplo n.º 3
0
 public sapi(AltBot bot,
             User user,
             Utils.SubQuery query,
             Request request,
             Result result,
             XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
 }
Ejemplo n.º 4
0
 public setstate(AltBot bot,
                 User user,
                 SubQuery query,
                 Request request,
                 Result result,
                 XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
 }
Ejemplo n.º 5
0
 public AIMLConstraintTagHandler(AltBot bot,
                                 User user,
                                 SubQuery query,
                                 Request request,
                                 Result result,
                                 XmlNode templateNode)
     : this(bot, user, query, request, result, templateNode, 1)
 {
 }
Ejemplo n.º 6
0
 public that(AltBot bot,
             User user,
             SubQuery query,
             Request request,
             Result result,
             XmlNode templateNode, int offset)
     : base(bot, user, query, request, result, templateNode, offset)
 {
 }
Ejemplo n.º 7
0
 /// <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 that(AltBot bot,
             User user,
             SubQuery query,
             Request request,
             Result result,
             XmlNode templateNode)
     : this(bot, user, query, request, result, templateNode, 1)
 {
 }
Ejemplo n.º 8
0
 public response_topic(AltBot bot,
         User user,
         SubQuery query,
         Request request,
         Result result,
         XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
 }
Ejemplo n.º 9
0
        private static T GetDictData0 <T>(IList <T> unifiables, string name, int startChars, out bool found) where T : IConvertible
        {
            string s = name.Substring(startChars);

            if (s == "*" || s == "ALL" || s == "0")
            {
                StringAppendableUnifiableImpl result = Unifiable.CreateAppendable();
                foreach (T u in unifiables)
                {
                    result.Append(u.ToString());
                }
                found = true;
                return(PASSTHRU <T>(result));
            }

            int uc = unifiables.Count;

            bool fromend = false;

            if (s.StartsWith("-"))
            {
                fromend = true;
                s       = s.Substring(1);
            }

            int i = Int32.Parse(s);

            if (i == 0)
            {
                if (uc == 0)
                {
                    found = true;
                    return(PASSTHRU <T>(""));
                }
            }
            int ii = i - 1;

            if (fromend)
            {
                ii = uc - i;
            }
            if (uc == 0)
            {
                AltBot.writeDebugLine(" !ERROR -star underflow! " + i + " in " + name);
                found = false;
                return(PASSTHRU <T>(String.Empty));
            }
            if (ii >= uc || ii < 0)
            {
                AltBot.writeDebugLine(" !ERROR -star badindexed 0 < " + i + " < " + uc + " in " + name);
                found = false;
                return(unifiables[ii]);
            }
            found = true;
            return(unifiables[ii]);
        }
Ejemplo n.º 10
0
        public static List <Unifiable> UnifyStars(string target, string source)
        {
            var             matchVars = new List <object>();
            string          me        = RegExFrom(target, matchVars);
            MatchCollection mc        = Regex.Matches(source, me, RegexOptions.IgnoreCase);

            if (mc.Count == 0)
            {
                if (matchVars.Count == 0)
                {
                    return(SUCCEED_NOVARS);
                }
                AltBot.writeDebugLine("DEBUG9: UnifyStars '" + me + "'!='" + source + "'");
                return(null);
            }
            if (mc.Count != matchVars.Count)
            {
                if (mc.Count == 1)
                {
                    Match mc1 = mc[0];
                    if (mc1.Success)
                    {
                        int mcLength = mc1.Length;
                        if (mcLength > 0)
                        {
                            if (mcLength == source.Length)
                            {
                                return(new List <Unifiable>()
                                {
                                    source
                                });
                            }
                        }
                    }
                    AltBot.writeDebugLine("ERROR: UnifyStars '" + me + "'!='" + source + "'");
                    return(null);
                }
            }
            int mi      = 0;
            var results = new List <Unifiable>(mc.Count);

            foreach (Match match in mc)
            {
                string mv = match.Value;
                object mp = matchVars[mi];
                if (UnifyValues(mp, mv))
                {
                    results.Add(mv);
                }
                else
                {
                    return(null);
                }
            }
            return(results);
        }
Ejemplo n.º 11
0
 /// <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 think(AltBot bot,
              User user,
              SubQuery query,
              Request request,
              Result result,
              XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
     IsStarAtomically = false;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="Proc">The Proc 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 LoadingTagHandler(AltBot bot,
                          User user,
                          SubQuery query,
                          Request request,
                          Result result,
                          XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
     isRecursive = false;
 }
Ejemplo n.º 13
0
 /// <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 sr(AltBot bot,
           User user,
           SubQuery query,
           Request request,
           Result result,
           XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
     IsDeterministic = false;
 }
Ejemplo n.º 14
0
 /// <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 StarTagHandler(AltBot bot,
                       User user,
                       SubQuery query,
                       Request request,
                       Result result,
                       XmlNode templateNode, int idx)
     : base(bot, user, query, request, result, templateNode)
 {
     DefaultIndex = idx;
 }
Ejemplo n.º 15
0
 public AIMLDictSubstFormatingTagHandler(AltBot bot,
                                         User user,
                                         SubQuery query,
                                         Request request,
                                         Result result,
                                         XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
     IsStarAtomically = true;
 }
Ejemplo n.º 16
0
 /// <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 thatstar(AltBot bot,
                 User user,
                 SubQuery query,
                 Request request,
                 Result result,
                 XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode, 1)
 {
     StarDict = () => CurrentQuery.ThatStars;
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="Proc">The Proc 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 root(AltBot bot,
             User user,
             SubQuery query,
             Request request,
             Result result,
             XmlNode templateNode, ParentProvider pp)
     : base(bot, user, query, request, result, templateNode)
 {
     GetTargetSettings = pp ?? (() => this.query.TargetSettings);
 }
Ejemplo n.º 18
0
 /// <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 btxml(AltBot bot,
              User user,
              Utils.SubQuery query,
              Request request,
              Result result,
              XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
     this.isRecursive = false;
 }
Ejemplo n.º 19
0
 /// <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 aimlexec(AltBot bot,
                 User user,
                 SubQuery query,
                 Request request,
                 Result result,
                 XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
     isRecursive = false;
 }
Ejemplo n.º 20
0
 /// <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 template(AltBot bot,
                 User user,
                 SubQuery query,
                 Request request,
                 Result result,
                 XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
     SelfProcessing = true;
 }
Ejemplo n.º 21
0
 /// <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 cycrandom(AltBot bot,
                  User user,
                  SubQuery query,
                  Request request,
                  Result result,
                  XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
     //  this.isRecursive = false;
 }
Ejemplo n.º 22
0
 /// <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 say(AltBot bot,
            User user,
            Utils.SubQuery query,
            Request request,
            Result result,
            XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
     isRecursive = true;
 }
Ejemplo n.º 23
0
 /// <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 botsetting(AltBot bot,
                   User user,
                   Utils.SubQuery query,
                   Request request,
                   Result result,
                   XmlNode templateNode, string settingGrab)
     : base(bot, user, query, request, result, templateNode)
 {
     SettingToGrab = settingGrab;
 }
Ejemplo n.º 24
0
 /// <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 filterqa(AltBot bot,
                 User user,
                 Utils.SubQuery query,
                 Request request,
                 Result result,
                 XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
     this.isRecursive = true;
     this.isBoring    = true;
 }
Ejemplo n.º 25
0
        public WebGetFactiodEngine(IEnglishFactiodEngine fallback, AltBot AltBot)
        {
            TheBot   = AltBot;
            assertTo = fallback;
// ReSharper disable DoNotCallOverridableMethodsInConstructor
            string named = GetServiceName();

// ReSharper restore DoNotCallOverridableMethodsInConstructor

            TheBot.AddExcuteHandler(named, AskTextString);
        }
Ejemplo n.º 26
0
 public AIMLConstraintTagHandler(AltBot bot,
                                 User user,
                                 SubQuery query,
                                 Request request,
                                 Result result,
                                 XmlNode templateNode, int offset)
     : base(bot, user, query, request, result, templateNode)
 {
     offetFrom        = offset;
     IsStarAtomically = false;
 }
Ejemplo n.º 27
0
 /// <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 format(AltBot bot,
               User user,
               SubQuery query,
               Request request,
               Result result,
               XmlNode templateNode, Func <Unifiable, Unifiable> formatter, Func <Unifiable, Unifiable> formattereach)
     : base(bot, user, query, request, result, templateNode)
 {
     UFormatter  = formatter;
     UFormatterE = formattereach;
 }
Ejemplo n.º 28
0
 /// <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 format_prev(AltBot bot,
                    User user,
                    Utils.SubQuery query,
                    Request request,
                    Result result,
                    XmlNode templateNode, Func <string, string> formatter)
     : base(bot, user, query, request, result, templateNode)
 {
     isRecursive = true;
     Formatter   = formatter;
 }
Ejemplo n.º 29
0
 public format(AltBot bot,
               User user,
               SubQuery query,
               Request request,
               Result result,
               XmlNode templateNode, Func <string, string> formatter, Func <string, string> formattereach)
     : base(bot, user, query, request, result, templateNode)
 {
     SFormatter  = formatter;
     SFormatterE = formattereach;
 }
Ejemplo n.º 30
0
 /// <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 lazyClosure(AltBot bot,
                    User user,
                    SubQuery query,
                    Request request,
                    Result result,
                    XmlNode templateNode)
     : base(bot, user, query, request, result, templateNode)
 {
     isRecursive = false;
     IsTraced    = true;
 }