ExamplePosAnnotator extends CleartkSequenceAnnotator<String> { public static AnalysisEngineDescription getClassifierDescription(String modelFileName) throws ResourceInitializationException { return AnalysisEngineFactory.createEngineDescription( ExamplePosAnnotator.class, GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH, modelFileName); }  void initialize(UimaContext context); void process(JCas jCas); static AnalysisEngineDescription getClassifierDescription(String modelFileName); static AnalysisEngineDescription getWriterDescription(String outputDirectory); static final String DEFAULT_OUTPUT_DIRECTORY; }
@Test public void testAnnotatorDescriptor() throws Exception { HideOutput hider = new HideOutput(); BuildTestExamplePosModel.main(); hider.restoreOutput(); String modelFileName = JarClassifierBuilder.getModelJarFile( ExamplePosAnnotator.DEFAULT_OUTPUT_DIRECTORY).getPath(); AnalysisEngineDescription posTaggerDescription = ExamplePosAnnotator.getClassifierDescription(modelFileName); AnalysisEngine engine = AnalysisEngineFactory.createEngine(posTaggerDescription); Object classifierJar = engine.getConfigParameterValue(GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH); Assert.assertEquals(modelFileName, classifierJar); engine.collectionProcessComplete(); }