private static void checkFeatureType ( Feature feature , String expectedType ) throws AnalysisEngineProcessException { if ( ! feature . getRange ( ) . getName ( ) . equals ( expectedType ) ) { throw new OpenNlpAnnotatorProcessException ( ExceptionMessages . WRONG_FEATURE_TYPE , new Object [ ] { feature . getName ( ) , expectedType } ) ; } }
Checks if the given feature has the expected type otherwise an exception is thrown .