@Test public void testFindFullFormInParentheses() throws Exception { CAS cas = CasCreationUtils.createCas( UIMAFramework.getXMLParser().parseAnalysisEngineDescription(new XMLInputSource(FILE_DESCRIPTOR_AE))); JCas testCas = null; testCas = cas.getJCas(); ResourceSpecifier spec; spec = UIMAFramework.getXMLParser().parseResourceSpecifier(new XMLInputSource(AA_DESCRIPTOR)); AnalysisEngine abbreAn = UIMAFramework.produceAnalysisEngine(spec); String text = "The Drosophila retinal-specific protein, TRP (transient receptor potential), is the founding member of a family of store-operated channels (SOCs) conserved from C. elegans to humans."; testCas.setDocumentText(text); Sentence sent = new Sentence(testCas, 0, text.length()); sent.addToIndexes(); abbreAn.process(cas); FSIterator<Annotation> abbrIt = testCas.getAnnotationIndex(Abbreviation.type).iterator(); assertTrue(abbrIt.hasNext()); Abbreviation abbreviation = (Abbreviation) abbrIt.next(); assertEquals("TRP", abbreviation.getCoveredText()); assertEquals("transient receptor potential", abbreviation.getExpan()); assertEquals("transient receptor potential", abbreviation.getTextReference().getCoveredText()); }
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; }