Exemplo n.º 1
0
        /// <summary>Loads treebank grammar from first argument and prints it.</summary>
        /// <remarks>
        /// Loads treebank grammar from first argument and prints it.
        /// Just a demonstration of functionality. <br />
        /// <code>usage: java MemoryTreebank treebankFilesPath</code>
        /// </remarks>
        /// <param name="args">array of command-line arguments</param>
        public static void Main(string[] args)
        {
            Timing.StartTime();
            Treebank treebank = new Edu.Stanford.Nlp.Trees.MemoryTreebank(null);

            treebank.LoadPath(args[0]);
            Timing.EndTime();
            System.Console.Out.WriteLine(treebank);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Return a MemoryTreebank where each
        /// Tree in the current treebank has been transformed using the
        /// TreeTransformer.
        /// </summary>
        /// <remarks>
        /// Return a MemoryTreebank where each
        /// Tree in the current treebank has been transformed using the
        /// TreeTransformer.  This Treebank is unchanged (assuming that the
        /// TreeTransformer correctly doesn't change input Trees).
        /// </remarks>
        /// <param name="treeTrans">The TreeTransformer to use</param>
        public override Treebank Transform(ITreeTransformer treeTrans)
        {
            Treebank mtb = new Edu.Stanford.Nlp.Trees.MemoryTreebank(Count, TreeReaderFactory());

            foreach (Tree t in this)
            {
                mtb.Add(treeTrans.TransformTree(t));
            }
            return(mtb);
        }