/** * @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 CommsIdentifier(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
/** * @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 CommsIdentifier(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
protected void createEntitiesDocument() { jCas.reset(); jCas.setDocumentText( "James went to London on 19th February 2015. His e-mail address is james@example.com"); Annotations.createPerson(jCas, 0, 5, "James"); Annotations.createLocation( jCas, 14, 20, "London", "{\"type\": \"Point\", \"coordinates\": [-0.1, 51.5]}"); Temporal d = Annotations.createTemporal(jCas, 24, 42, ""); d.setConfidence(1.0); CommsIdentifier ci = new CommsIdentifier(jCas); ci.setBegin(66); ci.setEnd(83); ci.setSubType("email"); ci.addToIndexes(); }
c.setBegin(cursor); c.setEnd(cursor + cell2.length()); c.addToIndexes();
ci.setBegin(66); ci.setEnd(83); ci.setSubType("email");
@Test public void testIds() throws Exception { JCas jCas = JCasSingleton.getJCasInstance(); jCas.setDocumentText("E-mail address: example@foo.com"); long currId = IdentityUtils.getInstance().getNewId(); BaleenAnnotation ba1 = new BaleenAnnotation(jCas); assertEquals(currId + 1, ba1.getInternalId()); assertEquals(HASH_ONE, ba1.getExternalId()); BaleenAnnotation ba2 = new BaleenAnnotation(jCas); assertEquals(currId + 2, ba2.getInternalId()); assertEquals(HASH_ONE, ba2.getExternalId()); BaleenAnnotation ba3 = new BaleenAnnotation(jCas); ba3.setInternalId(999); assertEquals(999, ba3.getInternalId()); assertEquals(HASH_ONE, ba3.getExternalId()); CommsIdentifier ci = new CommsIdentifier(jCas); ci.setBegin(16); ci.setEnd(31); ci.setSubType("email"); ci.addToIndexes(); assertEquals(currId + 4, ci.getInternalId()); assertEquals(HASH_TWO, ci.getExternalId()); } }