public double getTagSequenceProb ( ) { // System.err.println("Parse.getTagSequenceProb: "+type+" "+this); if ( this . parts . size ( ) == 1 && this . parts . get ( 0 ) . type . equals ( ShiftReduceParser . TOK_NODE ) ) { // System.err.println(this+" "+prob); return Math . log ( this . prob ) ; } else if ( this . parts . size ( ) == 0 ) { System . err . println ( "Parse.getTagSequenceProb: Wrong base case!" ) ; return 0.0 ; } else { double sum = 0.0 ; for ( final Parse parse : this . parts ) { sum += parse . getTagSequenceProb ( ) ; } return sum ; } }
Returns the probability associated with the pos - tag sequence assigned to this parse .