.forEach( reciever -> { final Relation r = new Relation(jCas); r.setBegin(offset); r.setEnd(offset);
.forEach( reciever -> { final Relation r = new Relation(jCas); r.setBegin(offset); r.setEnd(offset);
private Relation createRelation(JCas jCas, Entity e1, Entity e2) { final Relation p2l = new Relation(jCas); p2l.setSource(e2); p2l.setTarget(e1); p2l.setRelationshipType("from"); p2l.addToIndexes(); return p2l; } }
@Test public void testGetRelation() throws UIMAException { final JCas jCas = JCasSingleton.getJCasInstance(); final Relation r = new Relation(jCas); final RelationWrapper wrapper = new RelationWrapper(r); assertEquals(r, wrapper.getRelation()); }
final Relation a = new Relation(jCas); a.setBegin(r.getBegin()); a.setEnd(r.getEnd());
final Relation a = new Relation(jCas); a.setBegin(r.getBegin()); a.setEnd(r.getEnd());
l.addToIndexes(); final Relation r = new Relation(jCas); r.setBegin(text.indexOf("went")); r.setEnd(r.getBegin() + "went".length());
l.addToIndexes(); final Relation r = new Relation(jCas); r.setBegin(text.indexOf("went")); r.setEnd(r.getBegin() + "went".length());
@Test public void test() throws AnalysisEngineProcessException, ResourceInitializationException { final Person p = new Person(jCas); p.addToIndexes(); final Location l = new Location(jCas); p.addToIndexes(); final Relation p2l = new Relation(jCas); p2l.setSource(p); p2l.setTarget(l); p2l.setRelationshipType("went"); p2l.setRelationSubType("past"); p2l.addToIndexes(); final Relation p2p = new Relation(jCas); p2p.setSource(p); p2p.setTarget(p); p2p.setRelationshipType("knew"); p2p.addToIndexes(); processJCas("mongo", fongoErd); final List<Relation> select = new ArrayList<>(JCasUtil.select(jCas, Relation.class)); assertEquals(2, select.size()); }
l.addToIndexes(); final Relation r = new Relation(jCas); r.setBegin(text.indexOf("went")); r.setEnd(r.getBegin() + "went".length());
@Test public void testStrict() throws AnalysisEngineProcessException, ResourceInitializationException { final Person p = new Person(jCas); p.addToIndexes(); final Location l = new Location(jCas); p.addToIndexes(); final Relation p2l = new Relation(jCas); p2l.setSource(p); p2l.setTarget(l); p2l.setRelationshipType("went"); p2l.setRelationSubType("past"); p2l.addToIndexes(); final Relation p2p = new Relation(jCas); p2p.setSource(p); p2p.setTarget(p); p2p.setRelationshipType("went"); p2l.setRelationSubType("past"); p2p.addToIndexes(); processJCas("mongo", fongoErd, "strict", true); final List<Relation> select = new ArrayList<>(JCasUtil.select(jCas, Relation.class)); assertEquals(1, select.size()); }
p3.addToIndexes(); Relation r = new Relation(jCas); r.setBegin(0); r.setEnd(1);
@Test public void testRelations() throws UIMAException { final Person s = new Person(jCas); s.setValue("source"); final Location t = new Location(jCas); t.setValue("target"); final Relation r = new Relation(jCas); r.setSource(s); r.setTarget(t); r.setRelationshipType("check"); r.addToIndexes(); SimplePipeline.runPipeline(jCas, AnalysisEngineFactory.createEngine(Relations.class)); }
c.addToIndexes(); final Relation r1 = new Relation(jCas); r1.setBegin(0); r1.setEnd(10); final Relation r4 = new Relation(jCas); r4.setBegin(r1.getBegin()); r4.setEnd(r1.getEnd()); final Relation r5 = new Relation(jCas); r5.setBegin(r1.getBegin()); r5.setEnd(r1.getEnd()); final Relation r6 = new Relation(jCas); r6.setBegin(r1.getBegin()); r6.setEnd(r1.getEnd());
dt.setConfidence(1.0); Relation r = new Relation(jCas); r.setBegin(0); r.setEnd(20);