public void destroy() { mAnnotator.destroy(); }
public void initialize(UimaContext aContext) throws ResourceInitializationException { try { // wrap UimaContext in AnnotatorContext AnnotatorContext actxt = new AnnotatorContext_impl((UimaContextAdmin) aContext); mAnnotator.initialize(actxt); } catch (AnnotatorInitializationException e) { throw new ResourceInitializationException(e); } catch (AnnotatorConfigurationException e) { throw new ResourceInitializationException(e); } }
public void reconfigure() throws ResourceConfigurationException, ResourceInitializationException { try { mAnnotator.reconfigure(); } catch (AnnotatorConfigurationException e) { throw new ResourceConfigurationException(e); } catch (AnnotatorInitializationException e) { throw new ResourceInitializationException(e); } }
/** * Checks it the type system of the given CAS is different from the last type system this * component was operating on. If it is different, calls the typeSystemInit method on the * component. * @param aCAS - * @throws AnalysisEngineProcessException - */ public void checkTypeSystemChange(AbstractCas aCAS) throws AnalysisEngineProcessException { try { TypeSystem typeSystem; if (aCAS instanceof JCas) { typeSystem = ((JCas) aCAS).getTypeSystem(); } else // CAS { typeSystem = ((CAS) aCAS).getTypeSystem(); } if (typeSystem != mLastTypeSystem) { mAnnotator.typeSystemInit(typeSystem); mLastTypeSystem = typeSystem; } } catch (AnnotatorConfigurationException e) { throw new AnalysisEngineProcessException(e); } catch (AnnotatorInitializationException e) { throw new AnalysisEngineProcessException(e); } }