Ejemplo n.º 1
0
        private static void BuildDidNotTree(StatementNode root)
        {
            var didNotRoot = StatementTreeBuilder.BuildNewTree(StatementType.DidNot);

            didNotRoot.AddVerb("stab", "stabbed");
            didNotRoot.AddVerb("shoot", "shot");
            didNotRoot.AddVerb("strangle", "strangled");
            didNotRoot.AddVerb("maul", "mauled");
            didNotRoot.AddVerb("poison", "poisoned");
            didNotRoot.AddVerb("throw a piano on", "threw a piano on");

            didNotRoot.AddObject("the cat");
            didNotRoot.AddObject("Mr. Mulberry");
            didNotRoot.AddObject("Roger Rabbit");
            didNotRoot.AddObject("Mr. Boddy");

            didNotRoot.StatementType = StatementType.DidNot;

            root.AddNode(didNotRoot);
        }
Ejemplo n.º 2
0
        private static void BuildAttributeTrees(StatementNode root)
        {
            var adjectives = new List <string>
            {
                "tall", "evil", "bemustached", "a total slob"
            };

            var isRoot    = StatementTreeBuilder.BuildNewTree(StatementType.Is);
            var isNotRoot = StatementTreeBuilder.BuildNewTree(StatementType.IsNot);

            foreach (var adjective in adjectives)
            {
                isRoot.AddAdjective(adjective);
                isNotRoot.AddAdjective(adjective);
            }

            isRoot.StatementType    = StatementType.Is;
            isNotRoot.StatementType = StatementType.IsNot;

            root.AddNode(isNotRoot);
            root.AddNode(isRoot);
        }