PennTreeUtils { public static PennTreeNode selectDfs(PennTreeNode aNode, int aIndex) { return dfs(aIndex, new MutableInt(0), aNode); }  static PennTreeNode convertPennTree(Constituent aConstituent); static String escapeToken(String aToken); static String unescapeToken(String aToken); static String toText(PennTreeNode aNode); static PennTreeNode selectDfs(PennTreeNode aNode, int aIndex); static PennTreeNode parsePennTree(String aTree); static String toPennTree(PennTreeNode aNode); static String toPrettyPennTree(PennTreeNode aNode); static void trim(CharSequence aText, int[] aSpan); static boolean isEmpty(int aBegin, int aEnd); static boolean trimChar(final char aChar); static List<PennTreeNode> getPreTerminals(PennTreeNode aNode);  }
@Test @Ignore("No asserts yet!") public void testSelectDfs() { PennTreeNode n = parsePennTree( "(ROOT (S (NP (PRP It)) (VP (VBZ is) (PP (IN for) (NP (NP (DT this) (NN reason)) " + "(SBAR (IN that) (S (NP (NN deconstruction)) (VP (VP (VBZ remains) (NP (NP " + "(DT a) (JJ fundamental) (NN threat)) (PP (TO to) (NP (NNP Marxism))))) (, ,) " + "(CC and) (VP (PP (IN by) (NP (NP (NN implication)) (PP (TO to) (NP (JJ other) " + "(ADJP (JJ culturalist) (CC and) (JJ contextualizing)) " + "(NNS approaches)))))))))))) (. .)))"); System.out.println(selectDfs(n, 1)); System.out.println(selectDfs(n, 2)); System.out.println(selectDfs(n, 3)); System.out.println(selectDfs(n, 4)); System.out.println(selectDfs(n, 5)); System.out.println(selectDfs(n, 6)); System.out.println(selectDfs(n, 7)); System.out.println(selectDfs(n, 8)); System.out.println(selectDfs(n, 9)); System.out.println(selectDfs(n, 10)); System.out.println(selectDfs(n, 11)); System.out.println(selectDfs(n, 12)); }