src/Generic/edt/discmodel/CorefUtils.cpp
/**
 *  Add the non-ACE entities and entities of undetermined type from
 *  <code>entitySet</code> to a list of candidate entities.  The new
 *  entities should be sorted w.r.t. distance from a target Mention.
 *
 *  @param candidates the array to add to 
 *  @param entitySet the EntitySet
 *  @param ment the target Mention
 *  @param maxEntities the maximum number of entities to add
 *  @return the number of entities added to the array
 */
Add the non-ACE entities and entities of undetermined type from
entitySet to a list of candidate entities.  The new
entities should be sorted w.r.t. distance from a target Mention.


Add the non - ACE entities and entities of undetermined type from entitySet to a list of candidate entities . The new entities should be sorted w . r . t . distance from a target Mention .
int CorefUtils::addNearestEntities(GrowableArray<Entity *> &candidates, EntitySet *entitySet , Mention * ment, int maxEntities){
	const GrowableArray<Entity *> &other = entitySet->getEntitiesByType(EntityType::getOtherType());
	const GrowableArray<Entity *> &undet = entitySet->getEntitiesByType(EntityType::getUndetType());
	GrowableArray<Entity *> sortedNonACE(maxEntities);
	for (int i = 0; i < other.length(); i++) {
		Entity *ent = other[i];
		insertEntityIntoSortedArray(sortedNonACE, entitySet, ent, ment, maxEntities);
	}
	for (int i = 0; i < undet.length(); i++) {
		Entity *ent = undet[i];
		insertEntityIntoSortedArray(sortedNonACE, entitySet, ent, ment, maxEntities);
	}
	for (int i = 0; i < sortedNonACE.length(); i++)
		candidates.add(sortedNonACE[i]);
	return sortedNonACE.length();
}
int CorefUtils :: addNearestEntities ( GrowableArray < Entity * > & candidates , EntitySet * entitySet , Mention * ment , int maxEntities ) { const GrowableArray < Entity * > & other = entitySet -> getEntitiesByType ( EntityType :: getOtherType ( ) ) ; const GrowableArray < Entity * > & undet = entitySet -> getEntitiesByType ( EntityType :: getUndetType ( ) ) ; GrowableArray < Entity * > sortedNonACE ( maxEntities ) ; for ( int i = 0 ; i < other . length ( ) ; i ++ ) { Entity * ent = other [ i ] ; insertEntityIntoSortedArray ( sortedNonACE , entitySet , ent , ment , maxEntities ) ; } for ( int i = 0 ; i < undet . length ( ) ; i ++ ) { Entity * ent = undet [ i ] ; insertEntityIntoSortedArray ( sortedNonACE , entitySet , ent , ment , maxEntities ) ; } for ( int i = 0 ; i < sortedNonACE . length ( ) ; i ++ ) candidates . add ( sortedNonACE [ i ] ) ; return sortedNonACE . length ( ) ; }
Add the non-ACE entities and entities of undetermined type from
  <code>entitySet</code> to a list of candidate entities.
Add the non - ACE entities and entities of undetermined type from <code > entitySet< / code > to a list of candidate entities .