@Test public void testExistingReferentsMerge() throws Exception { AnalysisEngine corefCapAE = AnalysisEngineFactory.createEngine( CorefCapitalisationAndApostrophe.class, "mergeReferents", true); jCas.setDocumentText(TEXT); ReferenceTarget rt1 = Annotations.createReferenceTarget(jCas); ReferenceTarget rt2 = Annotations.createReferenceTarget(jCas); Person p1 = Annotations.createPerson(jCas, 0, 5, JAMES); p1.setReferent(rt1); Person p2 = Annotations.createPerson(jCas, 22, 27, JAMES_UC); p2.setReferent(rt2); corefCapAE.process(jCas); assertEquals(1, JCasUtil.select(jCas, ReferenceTarget.class).size()); ReferenceTarget rtt = JCasUtil.selectByIndex(jCas, ReferenceTarget.class, 0); Person p1t = JCasUtil.selectByIndex(jCas, Person.class, 0); Person p2t = JCasUtil.selectByIndex(jCas, Person.class, 1); assertEquals(rtt, p1t.getReferent()); assertEquals(rtt, p2t.getReferent()); }
private ReferenceTarget createReferenceTarget(JCas jCas) { ReferenceTarget rt = new ReferenceTarget(jCas); rt.setBegin(0); rt.setEnd(jCas.getDocumentText().length()); addToJCasIndex(rt); return rt; }
CorefCapitalisationAndApostrophe extends BaleenAnnotator { private ReferenceTarget createReferenceTarget(JCas jCas) { ReferenceTarget rt = new ReferenceTarget(jCas); rt.setBegin(0); rt.setEnd(jCas.getDocumentText().length()); addToJCasIndex(rt); return rt; } }
CorefCapitalisationAndApostrophe extends BaleenAnnotator { private ReferenceTarget createReferenceTarget(JCas jCas) { ReferenceTarget rt = new ReferenceTarget(jCas); rt.setBegin(0); rt.setEnd(jCas.getDocumentText().length()); addToJCasIndex(rt); return rt; }  }
CorefCapitalisationAndApostrophe extends BaleenAnnotator { private ReferenceTarget createReferenceTarget(JCas jCas) { ReferenceTarget rt = new ReferenceTarget(jCas); rt.setBegin(0); rt.setEnd(jCas.getDocumentText().length()); addToJCasIndex(rt); return rt; }  @Override void doProcess(JCas jCas); @Override AnalysisEngineAction getAction(); }
CorefCapitalisationAndApostrophe extends BaleenAnnotator { private ReferenceTarget createReferenceTarget(JCas jCas) { ReferenceTarget rt = new ReferenceTarget(jCas); rt.setBegin(0); rt.setEnd(jCas.getDocumentText().length()); addToJCasIndex(rt); return rt; }  @Override void doProcess(JCas jCas); @Override AnalysisEngineAction getAction(); static final String PARAM_MERGE_REFERENTS; }