Esempio n. 1
0
        public void Deserialize()
        {
            var resourceText = GetResourceText();
            var parseResult  = ParsedStatementFactory.CreateParsedStatement(resourceText);

            Assert.IsNotNull(parseResult.Tree);
            Assert.AreEqual("ROOT", parseResult.Tree.node.Value);
            var statementNode = parseResult.Tree.node.Nodes[0];

            Assert.AreEqual("S", statementNode.Value);
            Assert.AreEqual(2, statementNode.Nodes.Count());
            var vbzNode = statementNode.Nodes.Last().Nodes.First();

            Assert.AreEqual("VBZ", vbzNode.Value);
            Assert.AreEqual("likes", vbzNode.Leaf.Value);

            Assert.IsNotNull(parseResult.Dependencies);
            Assert.AreEqual(6, parseResult.Dependencies.Count());
            Assert.AreEqual("after", parseResult.Dependencies.Last().Governor);
            Assert.AreEqual("work", parseResult.Dependencies.Last().Dependent);
        }
Esempio n. 2
0
 public void DeserializeParsedStatement()
 {
     var resourceText = GetResourceText();
     var statement    = ParsedStatementFactory.CreateParsedStatement(resourceText);
 }