@Test public void testPostprocessing() throws Exception { JCas jCas = JCasFactory.createJCas(ALL_TYPES_NAME); jCas.setDocumentText("Tumor necrosis factor (TNF) is one thing. The TNF receptor(TNF-R) is another."); new Sentence(jCas, 0, 41).addToIndexes(); new Sentence(jCas, 42, jCas.getDocumentText().length()).addToIndexes(); AnalysisEngine engine = AnalysisEngineFactory.createEngine(AcronymAnnotator.class, AcronymAnnotator.PARAM_ACROLIST, BASE_PATH + "testresources/acrolist.txt"); engine.process(jCas.getCas()); Collection<Abbreviation> acronyms = JCasUtil.select(jCas, Abbreviation.class); assertEquals(2, acronyms.size()); Collection<AbbreviationLongform> longForms = JCasUtil.select(jCas, AbbreviationLongform.class); assertEquals(2, longForms.size()); }
public void process(JCas aJCas) { LOGGER.debug("[JACRO] processing document..."); try { JFSIndexRepository indexes = aJCas.getJFSIndexRepository(); FSIterator sentenceIter = indexes.getAnnotationIndex(Sentence.type).iterator(); String sentenceText; while (sentenceIter.hasNext()) { Sentence sentence = (Sentence) sentenceIter.next(); sentenceText = sentence.getCoveredText(); annotate(sentenceText, aJCas, sentence.getBegin()); } if (consistencyAnno) { ConsistencyAnnotator ca = new ConsistencyAnnotator(); ca.consistencyAnnotate(aJCas); } if (postprocessing) { Postprocessing.doPostprocessing(aJCas); } } catch (StringIndexOutOfBoundsException e) { LOGGER.error("typical Error in AcronymAnnotator.process() : StringIndexOutOfBounds"); } }
AcronymAnnotator extends JCasAnnotator_ImplBase { public void process(JCas aJCas) { LOGGER.debug("[JACRO] processing document..."); try { JFSIndexRepository indexes = aJCas.getJFSIndexRepository(); FSIterator sentenceIter = indexes.getAnnotationIndex(Sentence.type).iterator(); String sentenceText; while (sentenceIter.hasNext()) { Sentence sentence = (Sentence) sentenceIter.next(); sentenceText = sentence.getCoveredText(); annotate(sentenceText, aJCas, sentence.getBegin()); } if (consistencyAnno) { ConsistencyAnnotator ca = new ConsistencyAnnotator(); ca.consistencyAnnotate(aJCas); } if (postprocessing) { Postprocessing.doPostprocessing(aJCas); } } catch (StringIndexOutOfBoundsException e) { LOGGER.error("typical Error in AcronymAnnotator.process() : StringIndexOutOfBounds"); } } }
AcronymAnnotator extends JCasAnnotator_ImplBase { public void process(JCas aJCas) { LOGGER.debug("[JACRO] processing document..."); try { JFSIndexRepository indexes = aJCas.getJFSIndexRepository(); FSIterator sentenceIter = indexes.getAnnotationIndex(Sentence.type).iterator(); String sentenceText; while (sentenceIter.hasNext()) { Sentence sentence = (Sentence) sentenceIter.next(); sentenceText = sentence.getCoveredText(); annotate(sentenceText, aJCas, sentence.getBegin()); } if (consistencyAnno) { ConsistencyAnnotator ca = new ConsistencyAnnotator(); ca.consistencyAnnotate(aJCas); } if (postprocessing) { Postprocessing.doPostprocessing(aJCas); } } catch (StringIndexOutOfBoundsException e) { LOGGER.error("typical Error in AcronymAnnotator.process() : StringIndexOutOfBounds"); } }  }
AcronymAnnotator extends JCasAnnotator_ImplBase { public void process(JCas aJCas) { LOGGER.debug("[JACRO] processing document..."); try { JFSIndexRepository indexes = aJCas.getJFSIndexRepository(); FSIterator sentenceIter = indexes.getAnnotationIndex(Sentence.type).iterator(); String sentenceText; while (sentenceIter.hasNext()) { Sentence sentence = (Sentence) sentenceIter.next(); sentenceText = sentence.getCoveredText(); annotate(sentenceText, aJCas, sentence.getBegin()); } if (consistencyAnno) { ConsistencyAnnotator ca = new ConsistencyAnnotator(); ca.consistencyAnnotate(aJCas); } if (postprocessing) { Postprocessing.doPostprocessing(aJCas); } } catch (StringIndexOutOfBoundsException e) { LOGGER.error("typical Error in AcronymAnnotator.process() : StringIndexOutOfBounds"); } }  void initialize(UimaContext aContext); void process(JCas aJCas); }
AcronymAnnotator extends JCasAnnotator_ImplBase { public void process(JCas aJCas) { LOGGER.debug("[JACRO] processing document..."); try { JFSIndexRepository indexes = aJCas.getJFSIndexRepository(); FSIterator sentenceIter = indexes.getAnnotationIndex(Sentence.type).iterator(); String sentenceText; while (sentenceIter.hasNext()) { Sentence sentence = (Sentence) sentenceIter.next(); sentenceText = sentence.getCoveredText(); annotate(sentenceText, aJCas, sentence.getBegin()); } if (consistencyAnno) { ConsistencyAnnotator ca = new ConsistencyAnnotator(); ca.consistencyAnnotate(aJCas); } if (postprocessing) { Postprocessing.doPostprocessing(aJCas); } } catch (StringIndexOutOfBoundsException e) { LOGGER.error("typical Error in AcronymAnnotator.process() : StringIndexOutOfBounds"); } }  void initialize(UimaContext aContext); void process(JCas aJCas); static final String PARAM_ACROLIST; static final String PARAM_CONSISTENCY_ANNO; static final String PARAM_MAXLENGTH_FACTOR; }