public CategoryCollectorMultiWrapper(string s1, string s2, params string[] s) : base(s1)
 {
     if (s.Length == 0)
     {
         parent = CategoryCollector(s2);
     }
     else
     {
         var list = new List <string>(s);
         var s3   = s[0];
         list.RemoveAt(0);
         parent = new CategoryCollectorMultiWrapper(s2, s3, list.ToArray()).GetCollector();
     }
 }
        public void TestCollectEnglish()
        {
            var nodeCollector1 = new NodeCollector(parseTree1.GetRoot(), new IsEnglishLeaf());

            Assert.AreEqual(13, nodeCollector1.Collect().Count);
            nodeCollector1 = new NodeCollector(parseTree2.GetRoot(), new IsEnglishLeaf());
            Assert.AreEqual(15, nodeCollector1.Collect().Count);
            nodeCollector1 = new NodeCollector(parseTree3.GetRoot(), new IsEnglishLeaf());
            Assert.AreEqual(9, nodeCollector1.Collect().Count);
            nodeCollector1 = new NodeCollector(parseTree4.GetRoot(), new IsEnglishLeaf());
            Assert.AreEqual(10, nodeCollector1.Collect().Count);
            nodeCollector1 = new NodeCollector(parseTree5.GetRoot(), new IsEnglishLeaf());
            Assert.AreEqual(4, nodeCollector1.Collect().Count);
        }
        public void TestCollectNone()
        {
            NodeCollector nodeCollector1 = new NodeCollector(parseTree1.GetRoot(), null);

            Assert.AreEqual(34, nodeCollector1.Collect().Count);
            nodeCollector1 = new NodeCollector(parseTree2.GetRoot(), null);
            Assert.AreEqual(39, nodeCollector1.Collect().Count);
            nodeCollector1 = new NodeCollector(parseTree3.GetRoot(), null);
            Assert.AreEqual(32, nodeCollector1.Collect().Count);
            nodeCollector1 = new NodeCollector(parseTree4.GetRoot(), null);
            Assert.AreEqual(28, nodeCollector1.Collect().Count);
            nodeCollector1 = new NodeCollector(parseTree5.GetRoot(), null);
            Assert.AreEqual(9, nodeCollector1.Collect().Count);
        }
 public bool GetTruthValue(ParseTree t, NodeCollector collector)
 {
     return(GetTruthValue(collector(t)));
 }
 protected Rule(NodeCollector collector)
 {
     this.collector = collector;
 }
 public RuleOR(NodeCollector collector, params Rule[] rules) : base(collector)
 {
     this.rules = rules;
 }
 public RuleOutOfSet(RuleManager <string> .NamedSet ns, NodeCollector nc) : this(ns.Name, ns.Set, nc)
 {
 }
 public RuleOutOfSet(string name, HashSet <string> set, NodeCollector nc) : base(nc)
 {
     setName  = name;
     this.set = set;
 }
Ejemplo n.º 9
0
 public GroupComponent(long key)
 {
     this.Key           = key;
     this.nodeCollector = new GroupNodeCollectorImpl();
     this.members       = new HashSet <Entity>();
 }