예제 #1
0
        public virtual Tree TransformTree(Tree t)
        {
            Tree result = TransformTreeHelper(t);

            if (forceCNF)
            {
                result = new CNFTransformers.FromCNFTransformer().TransformTree(result);
            }
            return(boundaryRemover.TransformTree(result));
        }
예제 #2
0
        public static void Main(string[] args)
        {
            CategoryWordTag.printWordTag = false;
            string       path           = args[0];
            IList <Tree> trees          = TreebankAnnotator.GetTrees(path, 200, 219, 0, 10);
            IList <Tree> annotatedTrees = new TreebankAnnotator(new Options(), path).AnnotateTrees(trees);

            foreach (Tree tree in annotatedTrees)
            {
                System.Console.Out.WriteLine("ORIGINAL:\n");
                tree.PennPrint();
                System.Console.Out.WriteLine("CNFed:\n");
                Tree cnfTree = new CNFTransformers.ToCNFTransformer().TransformTree(tree);
                cnfTree.PennPrint();
                System.Console.Out.WriteLine("UnCNFed:\n");
                Tree unCNFTree = new CNFTransformers.FromCNFTransformer().TransformTree(cnfTree);
                unCNFTree.PennPrint();
                System.Console.Out.WriteLine("\n\n");
            }
        }