/** * @generated * @param jcas JCas to which this Feature Structure belongs * @param begin offset to the begin spot in the SofA * @param end offset to the end spot in the SofA */ public Chemical(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
/** * Internal - constructor used by generator * * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public Chemical(int addr, TOP_Type type) { super(addr, type); readObject(); }
@Test public void test() throws AnalysisEngineProcessException, ResourceInitializationException { jCas.setDocumentText( "The CAS Number for water is 7732-18-5, but carbon could be either CASRN:7440-44-0 or CAS Registry Number 7782-42-5. CAS Number 7440-44-5 is not valid."); processJCas(); assertEquals(3, JCasUtil.select(jCas, Chemical.class).size()); assertEquals("7732-18-5", JCasUtil.selectByIndex(jCas, Chemical.class, 0).getCoveredText()); assertEquals("7440-44-0", JCasUtil.selectByIndex(jCas, Chemical.class, 1).getCoveredText()); assertEquals("7782-42-5", JCasUtil.selectByIndex(jCas, Chemical.class, 2).getCoveredText()); } }
/** * Internal - constructor used by generator * * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public Chemical(int addr, TOP_Type type) { super(addr, type); readObject(); }
@Test public void test() throws Exception { jCas.setDocumentText( "He used hydrogen peroxide to dye his hair. The diamond was made of carbon-12."); languageAE.process(jCas); processJCas(); assertEquals(2, JCasUtil.select(jCas, Chemical.class).size()); assertEquals( "hydrogen peroxide", JCasUtil.selectByIndex(jCas, Chemical.class, 0).getCoveredText()); assertEquals("carbon-12", JCasUtil.selectByIndex(jCas, Chemical.class, 1).getCoveredText()); } }
/** * @generated * @param jcas JCas to which this Feature Structure belongs * @param begin offset to the begin spot in the SofA * @param end offset to the end spot in the SofA */ public Chemical(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
/** * @generated * @param jcas JCas to which this Feature Structure belongs */ public Chemical(JCas jcas) { super(jcas); readObject(); }
/** * @generated * @param jcas JCas to which this Feature Structure belongs */ public Chemical(JCas jcas) { super(jcas); readObject(); }