/** * @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 Url(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
/** * @generated * @param jcas JCas to which this Feature Structure belongs */ public Url(JCas jcas) { super(jcas); readObject(); }
return Optional.of(new Temporal(jCas)); case "Url": return Optional.of(new Url(jCas)); case "Vehicle": return Optional.of(new Vehicle(jCas));
@Test public void test() throws Exception { jCas.setDocumentText( "If you visit bbc.co.uk, then you may also want to visit bbc.co.uk/news or http://news.bbc.co.uk, or even news.bbc.co.uk/stories/view.php?id=123. But don't pull out james@example.com"); processJCas(); assertEquals(4, JCasUtil.select(jCas, Url.class).size()); Url url1 = JCasUtil.selectByIndex(jCas, Url.class, 0); assertEquals("bbc.co.uk", url1.getCoveredText()); Url url2 = JCasUtil.selectByIndex(jCas, Url.class, 1); assertEquals("bbc.co.uk/news", url2.getCoveredText()); Url url3 = JCasUtil.selectByIndex(jCas, Url.class, 2); assertEquals("http://news.bbc.co.uk", url3.getCoveredText()); Url url4 = JCasUtil.selectByIndex(jCas, Url.class, 3); assertEquals("news.bbc.co.uk/stories/view.php?id=123", url4.getCoveredText()); } }
/** * Internal - constructor used by generator * * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public Url(int addr, TOP_Type type) { super(addr, type); readObject(); }
return Optional.of(new Temporal(jCas)); case "Url": return Optional.of(new Url(jCas)); case "Vehicle": return Optional.of(new Vehicle(jCas));
/** * @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 Url(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 Url(int addr, TOP_Type type) { super(addr, type); readObject(); }
/** * @generated * @param jcas JCas to which this Feature Structure belongs */ public Url(JCas jcas) { super(jcas); readObject(); }