src/Generic/theories/MentionConfidence.cpp
/* true if this entity is the only one of the matching type mentioned in this mention's sentence or earlier */
true if this entity is the only one of the matching type mentioned in this mention's sentence or earlier
true if this entity is the only one of the matching type mentioned in this mention ' s sentence or earlier
bool MentionConfidence::isMentOnlyPrecedingTypeMatch(const Mention* ment, EntityType entType, const Entity *ent, const EntitySet *ent_set){
	if(!(ment->getEntityType() == entType)){
		return false;
	}
	int sent_no = ment->getSentenceNumber();
	for (int ent_no = 0; ent_no < ent_set->getNEntities(); ent_no++){
		const Entity* oth_ent = ent_set->getEntity(ent_no);
		if (oth_ent->getType() == entType && oth_ent->getID() != ent->getID()){ 
			for (int oment_no = 0; oment_no < oth_ent->getNMentions(); oment_no++){
				MentionUID oment_uid = oth_ent->getMention(oment_no);
				int osent_no = oment_uid.sentno();
				if (osent_no <= sent_no){
					return false;
				}
			}
		}
	}
	return true;
}
bool MentionConfidence :: isMentOnlyPrecedingTypeMatch ( const Mention * ment , EntityType entType , const Entity * ent , const EntitySet * ent_set ) { if ( ! ( ment -> getEntityType ( ) == entType ) ) { return false ; } int sent_no = ment -> getSentenceNumber ( ) ; for ( int ent_no = 0 ; ent_no < ent_set -> getNEntities ( ) ; ent_no ++ ) { const Entity * oth_ent = ent_set -> getEntity ( ent_no ) ; if ( oth_ent -> getType ( ) == entType && oth_ent -> getID ( ) != ent -> getID ( ) ) { for ( int oment_no = 0 ; oment_no < oth_ent -> getNMentions ( ) ; oment_no ++ ) { MentionUID oment_uid = oth_ent -> getMention ( oment_no ) ; int osent_no = oment_uid . sentno ( ) ; if ( osent_no <= sent_no ) { return false ; } } } } return true ; }
true if this entity is the only one of the matching type mentioned in this mention's sentence or earlier
true if this entity is the only one of the matching type mentioned in this mention ' s sentence or earlier