private static Collection < String > addOtherClasses ( Collection < String > feats , List < ? extends CoreLabel > info , int loc , Clique c ) { String addend = null ; String pAnswer = info . get ( loc - 1 ) . get ( AnswerAnnotation . class ) ; String p2Answer = info . get ( loc - 2 ) . get ( AnswerAnnotation . class ) ; String p3Answer = info . get ( loc - 3 ) . get ( AnswerAnnotation . class ) ; String p4Answer = info . get ( loc - 4 ) . get ( AnswerAnnotation . class ) ; String p5Answer = info . get ( loc - 5 ) . get ( AnswerAnnotation . class ) ; String nAnswer = info . get ( loc + 1 ) . get ( AnswerAnnotation . class ) ; // cdm 2009: Is this really right? Do we not need to differentiate names that would collide??? if ( c == FeatureFactory . cliqueCpC ) { addend = ' ' + pAnswer ; } else if ( c == FeatureFactory . cliqueCp2C ) { addend = ' ' + p2Answer ; } else if ( c == FeatureFactory . cliqueCp3C ) { addend = ' ' + p3Answer ; } else if ( c == FeatureFactory . cliqueCp4C ) { addend = ' ' + p4Answer ; } else if ( c == FeatureFactory . cliqueCp5C ) { addend = ' ' + p5Answer ; } else if ( c == FeatureFactory . cliqueCpCp2C ) { addend = ' ' + pAnswer + ' ' + p2Answer ; } else if ( c == FeatureFactory . cliqueCpCp2Cp3C ) { addend = ' ' + pAnswer + ' ' + p2Answer + ' ' + p3Answer ; } else if ( c == FeatureFactory . cliqueCpCp2Cp3Cp4C ) { addend = ' ' + pAnswer + ' ' + p2Answer + ' ' + p3Answer + ' ' + p4Answer ; } else if ( c == FeatureFactory . cliqueCpCp2Cp3Cp4Cp5C ) { addend = ' ' + pAnswer + ' ' + p2Answer + ' ' + p3Answer + ' ' + p4Answer + ' ' + p5Answer ; } else if ( c == FeatureFactory . cliqueCnC ) { addend = ' ' + nAnswer ; } else if ( c == FeatureFactory . cliqueCpCnC ) { addend = ' ' + pAnswer + ' ' + nAnswer ; } if ( addend == null ) { return feats ; } Collection < String > newFeats = new HashSet < String > ( ) ; for ( String feat : feats ) { String newFeat = feat + addend ; newFeats . add ( newFeat ) ; } return newFeats ; }
This adds to the feature name the name of classes that are other than the current class that are involved in the clique . In the CMM these other classes become part of the conditioning feature and only the class of the current position is being predicted .