src/Generic/docentities/StrategicEntityLinker.cpp
// return a name entity with fewest possible mentions

return a name entity with fewest possible mentions
return a name entity with fewest possible mentions
Entity* StrategicEntityLinker::_getSmallestNameEntity(const EntitySet* ents, EntityType type) {
	int smallest = 0;
	Entity* currEnt = 0;
	for (int i=0; i < ents->getNEntities(); i++) {
		Entity* ent = ents->getEntity(i);
		if (ent->getType() != type)
			continue;
		if (smallest > 0 && ent->getNMentions() >= smallest)
			continue;
		bool seenName = false;
		for (int j=0; j < ent->getNMentions(); j++) {
			Mention* ment = ents->getMention(ent->getMention(0));
			if (ment->mentionType == Mention::NAME) {
				seenName = true;
				break;
			}
		}
		if (!seenName)
			continue;
		smallest = ent->getNMentions();
		currEnt = ent;
	}
	return currEnt;
}
Entity * StrategicEntityLinker :: _getSmallestNameEntity ( const EntitySet * ents , EntityType type ) { int smallest = 0 ; Entity * currEnt = 0 ; for ( int i = 0 ; i < ents -> getNEntities ( ) ; i ++ ) { Entity * ent = ents -> getEntity ( i ) ; if ( ent -> getType ( ) != type ) continue ; if ( smallest > 0 && ent -> getNMentions ( ) >= smallest ) continue ; bool seenName = false ; for ( int j = 0 ; j < ent -> getNMentions ( ) ; j ++ ) { Mention * ment = ents -> getMention ( ent -> getMention ( 0 ) ) ; if ( ment -> mentionType == Mention :: NAME ) { seenName = true ; break ; } } if ( ! seenName ) continue ; smallest = ent -> getNMentions ( ) ; currEnt = ent ; } return currEnt ; }
return a name entity with fewest possible mentions
return a name entity with fewest possible mentions