protected Tree < FeatureStructure > populateTree ( JCas jcas ) { Tree < FeatureStructure > tree = new Tree < FeatureStructure > ( jcas . getDocumentAnnotationFs ( ) ) ; for ( TOP a : JCasUtil . select ( jcas , annotationTypes . get ( 0 ) ) ) { tree . add ( populateTree ( jcas , a , 1 ) ) ; } return tree ; }
This is the entry point for Tree construction . The root is the document node .