/** * vng use the constructor identified during initialization to create the * lookup token * * @param bta * @return * @throws AnnotatorInitializationException */ private LookupToken annoToLookupToken(Annotation bta) throws AnnotatorInitializationException { try { return (LookupToken) lookupTokenAdapterCtor.newInstance(bta); } catch (InvocationTargetException e) { throw new AnnotatorInitializationException(e); } catch (IllegalArgumentException e) { throw new AnnotatorInitializationException(e); } catch (InstantiationException e) { throw new AnnotatorInitializationException(e); } catch (IllegalAccessException e) { throw new AnnotatorInitializationException(e); } }
/** * Initialisiation of UIMA-JNET. Reads in and checks descriptor's parameters. * * @throws ResourceInitializationException */ @Override public void initialize(final UimaContext aContext) throws ResourceInitializationException { LOGGER.info("initialize() - initializing JPOS..."); // invoke default initialization super.initialize(aContext); // get modelfilename from parameters try { // compulsory params setModel(aContext); postagset = (String) aContext.getConfigParameterValue("tagset"); } catch (final AnnotatorContextException e) { e.printStackTrace(); throw new ResourceInitializationException(); } catch (final AnnotatorConfigurationException e) { e.printStackTrace(); throw new ResourceInitializationException(); } catch (final AnnotatorInitializationException e) { e.printStackTrace(); throw new ResourceInitializationException(); } }
/** * vng use the constructor identified during initialization to create the * lookup token * * @param bta * @return * @throws AnnotatorInitializationException */ private LookupToken annoToLookupToken(Annotation bta) throws AnnotatorInitializationException { try { return (LookupToken) lookupTokenAdapterCtor.newInstance(bta); } catch (InvocationTargetException e) { throw new AnnotatorInitializationException(e); } catch (IllegalArgumentException e) { throw new AnnotatorInitializationException(e); } catch (InstantiationException e) { throw new AnnotatorInitializationException(e); } catch (IllegalAccessException e) { throw new AnnotatorInitializationException(e); } }
LOGGER.error("setModel() - Could not load JPOS model from " + new File(modelFilename).getAbsolutePath() + ": " + e.getMessage(), e); throw new AnnotatorInitializationException();
/** * {@inheritDoc} */ @Override public Iterator<Annotation> getLookupWindowIterator( final JCas jcas ) throws AnnotatorInitializationException { try { final JFSIndexRepository indexes = jcas.getJFSIndexRepository(); final String objClassName = iv_props.getProperty( WINDOW_ANNOT_PRP_KEY ); int windowType; try { windowType = JCasUtil.getType( objClassName ); } catch ( IllegalArgumentException iaE ) { // thrown by JCasUtil.getType() throw new AnnotatorInitializationException( iaE ); } return indexes.getAnnotationIndex( windowType ).iterator(); } catch ( Exception e ) { // TODO specify exceptions, get rid of the catch for "Exception" throw new AnnotatorInitializationException( e ); } }
/** * {@inheritDoc} */ @Override public Iterator<Annotation> getLookupWindowIterator( final JCas jcas ) throws AnnotatorInitializationException { try { final JFSIndexRepository indexes = jcas.getJFSIndexRepository(); final String objClassName = iv_props.getProperty( WINDOW_ANNOT_PRP_KEY ); int windowType; try { windowType = JCasUtil.getType( objClassName ); } catch ( IllegalArgumentException iaE ) { // thrown by JCasUtil.getType() throw new AnnotatorInitializationException( iaE ); } return indexes.getAnnotationIndex( windowType ).iterator(); } catch ( Exception e ) { // TODO specify exceptions, get rid of the catch for "Exception" throw new AnnotatorInitializationException( e ); } }
} catch (Exception e) { LOGGER.error("setModel() - Could not load JNET model: " + e.getMessage(), e); throw new AnnotatorInitializationException();
/** * {@inheritDoc} */ @Override public Iterator<Annotation> getLookupWindowIterator( final JCas jcas ) throws AnnotatorInitializationException { try { final JFSIndexRepository indexes = jcas.getJFSIndexRepository(); final String objClassName = iv_props.getProperty( WINDOW_ANNOT_PRP_KEY ); int windowType; try { windowType = JCasUtil.getType( objClassName ); } catch ( IllegalArgumentException iaE ) { // thrown by JCasUtil.getType() throw new AnnotatorInitializationException( iaE ); } return indexes.getAnnotationIndex( windowType ).iterator(); } catch ( Exception e ) { // TODO specify exceptions, get rid of the catch for "Exception" throw new AnnotatorInitializationException( e ); } }
/** * {@inheritDoc} */ @Override public Iterator<Annotation> getLookupWindowIterator( final JCas jcas ) throws AnnotatorInitializationException { try { final JFSIndexRepository indexes = jcas.getJFSIndexRepository(); final String objClassName = iv_props.getProperty( WINDOW_ANNOT_PRP_KEY ); int windowType; try { windowType = JCasUtil.getType( objClassName ); } catch ( IllegalArgumentException iaE ) { // thrown by JCasUtil.getType() throw new AnnotatorInitializationException( iaE ); } return indexes.getAnnotationIndex( windowType ).iterator(); } catch ( Exception e ) { // TODO specify exceptions, get rid of the catch for "Exception" throw new AnnotatorInitializationException( e ); } }
throw new AnnotatorInitializationException(new Exception( "Unable to locate resource with key=" + LVGCMDAPI_RESRC_KEY + "."));
throw new AnnotatorInitializationException(new Exception( "Unable to locate resource with key=" + LVGCMDAPI_RESRC_KEY + "."));
logger.logError(PARAM_TOKENANNOTATION + " '" + tokenAnnotationName + "' specified, but does not exist"); throw new AnnotatorInitializationException(); logger.logError(PARAM_TOKENTEXTFEATURENAME + " '" + tokenTextFeatureName + "' specified, but does not exist for type: " + tokenType.getName()); throw new AnnotatorInitializationException(); + tokenClassWriteBackFeatureNames[i] + "' specified, but does not exist for type: " + tokenType.getName()); throw new AnnotatorInitializationException(); logger.logError(PARAM_DATA_BLOCK_FS + " '" + spanFeatureStructureName + "' specified, but does not exist for type: " + tokenType.getName()); throw new AnnotatorInitializationException(); logger.logError(PARAM_ANNOTATION_NAME + " '" + resultAnnotationName + "' specified, but does not exist"); throw new AnnotatorInitializationException(); logger.logError(PARAM_ENCLOSINGSPAN + " '" + resultEnclosingSpanName + "' specified, but does not exist for type: " + resultAnnotationType.getName()); throw new AnnotatorInitializationException(); logger.logError(PARAM_MATCHEDFEATURE + " '" + resultMatchedTextFeatureName + "' specified, but does not exist for type: " + resultAnnotationType.getName()); throw new AnnotatorInitializationException(); logger.logError(PARAM_MATCHEDTOKENSFEATURENAME + " '" + matchedTokensFeatureName