public IParsedPhrase GetPropogated(Context env, string name)
 {
     Variable dummy = new Variable(name);
     return dummy.Produce(env, tagger, parser);
 }
        // This will call success either way, but only propogate if context is empty
        public bool PropogateOnClear(Context context, IContinuation succ, IFailure fail, params object[] args)
        {
            if (context.IsEmpty || (context.Contents.Count == 1 && context.Contents[0].Name.StartsWith("*")))
            {
                string name = (string) args[0];
                object check = args[1];

                Variable dummy = new Variable(name);
                dummy.Propogate(context, check, context.Weight);
            }

            succ.Continue(context, fail);

            return true;
        }
예제 #3
0
 public Thinker(double salience, Memory memory, List<Relations.Relation> kinds, Datum check, IContinuation succ, Variable.GetValue propfunc, params object[] propargs)
     : this(salience, memory, kinds, check, succ)
 {
     this.propfunc = propfunc;
     this.propargs = propargs;
 }
예제 #4
0
 public static void SearchForMatch(double salience, Memory memory, List<Relations.Relation> kinds, Datum check, Context context, IContinuation succ, IFailure fail, Variable.GetValue propfunc, params object[] propargs)
 {
     Thinker thinker = new Thinker(salience, memory, kinds, check, succ, propfunc, propargs);
     thinker.Continue(context, fail);
 }
 public PhraseVariable(double salience, Variable variable, POSTagger tagger, GrammarParser parser)
     : base(ArgumentMode.RemainderUnevaluated, salience, 4, 10, tagger, parser)
 {
     this.variable = variable;
 }