public static void main ( String [ ] args ) { //TreeFactory tf = new LabeledScoredTreeFactory(); Tree stringyTree = null ; try { stringyTree = ( new PennTreeReader ( new StringReader ( "(S (VP (VBZ Try) (NP (DT this))) (. .))" ) , new LabeledScoredTreeFactory ( new StringLabelFactory ( ) ) ) ) . readTree ( ) ; } catch ( IOException e ) { // do nothing } System . out . println ( stringyTree ) ; Function < Tree , Tree > a = getLabeledTreeToCategoryWordTagTreeFunction ( ) ; Tree adaptyTree = a . apply ( stringyTree ) ; System . out . println ( adaptyTree ) ; adaptyTree . percolateHeads ( new CollinsHeadFinder ( ) ) ; System . out . println ( adaptyTree ) ; Function < Tree , Tree > b = getLabeledTreeToStringLabeledTreeFunction ( ) ; Tree stringLabelTree = b . apply ( adaptyTree ) ; System . out . println ( stringLabelTree ) ; }
This method just tests the functionality of the included transformers .