public ContextHit getContextHit(List tokenList, int scope) throws AnnotatorProcessException { List fsmTokenList = wrapAsFsmTokens(tokenList); try { Set s = iv_negIndicatorFSM.execute(fsmTokenList); if (s.size() > 0) { NegationIndicator neg = (NegationIndicator) s.iterator().next(); return new ContextHit(neg.getStartOffset(), neg.getEndOffset()); } else { return null; } } catch (Exception e) { throw new AnnotatorProcessException(e); } }
} catch (Exception aep) { try { throw new AnnotatorProcessException(aep); } catch (AnnotatorProcessException e) { e.printStackTrace();
} catch (Exception aep) { try { throw new AnnotatorProcessException(aep); } catch (AnnotatorProcessException e) { e.printStackTrace();
} catch (UimacppException e) { logJTafException(e); throw new AnnotatorProcessException(e); } catch (SAXException e) { throw new AnnotatorProcessException(e); } catch (IOException e) { throw new AnnotatorProcessException(e);
public ContextHit getContextHit(List tokenList, int scope) throws AnnotatorProcessException { List fsmTokenList = wrapAsFsmTokens(tokenList); try { Set s = iv_negIndicatorFSM.execute(fsmTokenList); if (s.size() > 0) { NegationIndicator neg = (NegationIndicator) s.iterator().next(); return new ContextHit(neg.getStartOffset(), neg.getEndOffset()); } else { return null; } } catch (Exception e) { throw new AnnotatorProcessException(e); } }
private void performRecordResolution(JCas jcas_local) throws AnnotatorProcessException { // CAS represents a single sentence try { // should be only one RecordSentence object produced by // the I2B2XmlReader collection reader Iterator<?> rsItr = jcas_local.getJFSIndexRepository() .getAnnotationIndex(RecordSentence.type).iterator(); if (rsItr.hasNext()) { // should be only one final NominalAttributeValue object // produced by // the ResolutionAnnotator. Iterator<?> navItr = jcas_local.getJFSIndexRepository() .getAnnotationIndex(NominalAttributeValue.type) .iterator(); while (navItr.hasNext()) { NominalAttributeValue nav = (NominalAttributeValue) navItr .next(); String classification = nav.getNominalValue(); storeAssignedClasses(classification); } } } catch (Exception e) { e.printStackTrace(); throw new AnnotatorProcessException(e); } }
private void performRecordResolution(JCas jcas_local) throws AnnotatorProcessException { // CAS represents a single sentence try { // should be only one RecordSentence object produced by // the I2B2XmlReader collection reader Iterator<?> rsItr = jcas_local.getJFSIndexRepository() .getAnnotationIndex(RecordSentence.type).iterator(); if (rsItr.hasNext()) { // should be only one final NominalAttributeValue object // produced by // the ResolutionAnnotator. Iterator<?> navItr = jcas_local.getJFSIndexRepository() .getAnnotationIndex(NominalAttributeValue.type) .iterator(); while (navItr.hasNext()) { NominalAttributeValue nav = (NominalAttributeValue) navItr .next(); String classification = nav.getNominalValue(); storeAssignedClasses(classification); } } } catch (Exception e) { e.printStackTrace(); throw new AnnotatorProcessException(e); } }
} else throw new AnnotatorProcessException(new Exception( "Nominal value not part of " + Const.class + ": " + nVal));
} else throw new AnnotatorProcessException(new Exception( "Nominal value not part of " + Const.class + ": " + nVal));
throw new AnnotatorProcessException(e);