/** * Gets the all annotation which are an entity or which have a referent target which is also the * referent target of an entity. * * <p>Effectively get any annotation where the covered text is considered to be an entity. * * @param jCas the j cas * @param referentMap the referent map * @return the all entity or referent to entity */ public static List<Base> getAllEntityOrReferentToEntity( JCas jCas, Map<ReferenceTarget, Entity> referentMap) { return getAllAndReferents(jCas, Entity.class, referentMap); }
/** * Gets the all annotation which are an entity or which have a referent target which is also the * referent target of an entity. * * <p>Effectively get any annotation where the covered text is considered to be an entity. * * @param jCas the j cas * @param referentMap the referent map * @return the all entity or referent to entity */ public static List<Base> getAllEntityOrReferentToEntity( JCas jCas, Map<ReferenceTarget, Entity> referentMap) { return getAllAndReferents(jCas, Entity.class, referentMap); }
@Test public void testGetAllAndReferents() { final Map<ReferenceTarget, Entity> referentMap = new HashMap<>(); final List<Base> list = ReferentUtils.getAllAndReferents(jCas, Entity.class, referentMap); assertEquals(5, list.size()); }