@Test public void testStreamReferent() { final Map<ReferenceTarget, Entity> referentMap = new HashMap<>(); referentMap.put(chrisRT, chris); referentMap.put(londonRT, london); final Stream<Base> stream = ReferentUtils.streamReferent(jCas, referentMap); assertEquals(4, stream.count()); }
public static <T extends Base> Stream<Base> streamReferent( JCas jCas, Map<ReferenceTarget, T> referentMap) { return JCasUtil.select(jCas, Base.class).stream() .filter(p -> p.getReferent() != null && referentMap.get(p.getReferent()) != null); }
ReferentUtils { public static <T extends Base> Stream<Base> streamReferent( JCas jCas, Map<ReferenceTarget, T> referentMap) { return JCasUtil.select(jCas, Base.class).stream() .filter(p -> p.getReferent() != null && referentMap.get(p.getReferent()) != null); } }
ReferentUtils { public static <T extends Base> Stream<Base> streamReferent( JCas jCas, Map<ReferenceTarget, T> referentMap) { return JCasUtil.select(jCas, Base.class).stream() .filter(p -> p.getReferent() != null && referentMap.get(p.getReferent()) != null); } private  ReferentUtils(); }
ReferentUtils { public static <T extends Base> Stream<Base> streamReferent( JCas jCas, Map<ReferenceTarget, T> referentMap) { return JCasUtil.select(jCas, Base.class).stream() .filter(p -> p.getReferent() != null && referentMap.get(p.getReferent()) != null); } private  ReferentUtils(); static Multimap<ReferenceTarget, T> createReferentMap(
      final JCas jCas, final Class<T> clazz); static Multimap<ReferenceTarget, T> createReferentMap(
      final JCas jCas, final Class<T> clazz, final boolean filterEmptyReference); static Multimap<ReferenceTarget, T> createReferentMap(
      final JCas jCas, final Collection<T> mentions, final boolean filterEmptyReference); static Map<ReferenceTarget, T> filterToSingle(
      Multimap<ReferenceTarget, T> referentMap, Function<Collection<T>, T> convert); static List<Base> getAllEntityOrReferentToEntity(
      JCas jCas, Map<ReferenceTarget, Entity> referentMap); @SuppressWarnings("unlikely-arg-type") static List<Base> getAllAndReferents(
      JCas jCas, Class<T> clazz, Map<ReferenceTarget, T> referentMap); static Stream<Base> streamReferent(
      JCas jCas, Map<ReferenceTarget, T> referentMap); static T getLongestSingle(Collection<T> list); static T singleViaCompare(Collection<T> list, Comparator<T> compare); static Set<Entity> replaceWithCoreferent(
      Collection<Entity> entities, Map<ReferenceTarget, Entity> referentMap); }
ReferentUtils { public static <T extends Base> Stream<Base> streamReferent( JCas jCas, Map<ReferenceTarget, T> referentMap) { return JCasUtil.select(jCas, Base.class).stream() .filter(p -> p.getReferent() != null && referentMap.get(p.getReferent()) != null); } private  ReferentUtils(); static Multimap<ReferenceTarget, T> createReferentMap(
      final JCas jCas, final Class<T> clazz); static Multimap<ReferenceTarget, T> createReferentMap(
      final JCas jCas, final Class<T> clazz, final boolean filterEmptyReference); static Multimap<ReferenceTarget, T> createReferentMap(
      final JCas jCas, final Collection<T> mentions, final boolean filterEmptyReference); static Map<ReferenceTarget, T> filterToSingle(
      Multimap<ReferenceTarget, T> referentMap, Function<Collection<T>, T> convert); static List<Base> getAllEntityOrReferentToEntity(
      JCas jCas, Map<ReferenceTarget, Entity> referentMap); @SuppressWarnings("unlikely-arg-type") static List<Base> getAllAndReferents(
      JCas jCas, Class<T> clazz, Map<ReferenceTarget, T> referentMap); static Stream<Base> streamReferent(
      JCas jCas, Map<ReferenceTarget, T> referentMap); static T getLongestSingle(Collection<T> list); static T singleViaCompare(Collection<T> list, Comparator<T> compare); static Set<Entity> replaceWithCoreferent(
      Collection<Entity> entities, Map<ReferenceTarget, Entity> referentMap); static final Predicate<? super Base> NOT_ENTITY_OR_REFERENT; static final Predicate<? super Base> ENTITY_OR_REFERENT; }