int function ( ) { if ( isLeaf ( ) ) { return 0 ; } int loc0 = 0 ; List < Tree > loc1 = children ( ) ; for ( Tree loc2 : loc1 ) { int loc3 = loc2 . depth ( ) ; if ( loc3 > loc0 ) { loc0 = loc3 ; } } return loc0 + 1 ; }
finds the depth of the tree . the depth is defined as the length of the longest path from this node to a leaf node . leaf nodes have depth zero . pos tags have depth 1 . phrasal nodes have depth > = 2 . concode_field_sep Tree parent concode_elem_sep String headWord concode_elem_sep String label concode_elem_sep String parse concode_elem_sep double error concode_elem_sep String type concode_elem_sep List<String> tags concode_elem_sep List<Tree> children concode_elem_sep INDArray prediction concode_elem_sep int goldLabel concode_elem_sep INDArray vector concode_elem_sep List<String> tokens concode_elem_sep int end concode_elem_sep String value concode_elem_sep int begin concode_field_sep Tree parent concode_elem_sep Tree parent concode_elem_sep int getBegin concode_elem_sep List<String> getTokens concode_elem_sep void setTags concode_elem_sep double error concode_elem_sep boolean isLeaf concode_elem_sep List<T> getLeaves concode_elem_sep List<T> getLeaves concode_elem_sep void setPrediction concode_elem_sep void setTokens concode_elem_sep List<Tree> children concode_elem_sep double errorSum concode_elem_sep Tree firstChild concode_elem_sep Tree lastChild concode_elem_sep int hashCode concode_elem_sep List<String> yield concode_elem_sep List<String> yield concode_elem_sep INDArray vector concode_elem_sep String getHeadWord concode_elem_sep void setParent concode_elem_sep void setEnd concode_elem_sep String value concode_elem_sep boolean isPreTerminal concode_elem_sep void setHeadWord concode_elem_sep void connect concode_elem_sep void setVector concode_elem_sep Tree ancestor concode_elem_sep void setBegin concode_elem_sep String label concode_elem_sep void setType concode_elem_sep int getEnd concode_elem_sep List<String> tags concode_elem_sep Tree traverse concode_elem_sep List<Tree> getChildren concode_elem_sep void setParse concode_elem_sep String getType concode_elem_sep void setError concode_elem_sep void setValue concode_elem_sep boolean equals concode_elem_sep Tree clone concode_elem_sep INDArray prediction concode_elem_sep int goldLabel concode_elem_sep void setLabel concode_elem_sep String toString concode_elem_sep void setGoldLabel