src/Generic/theories/MentionConfidence.cpp
/* true if the name of entity precedes (or is) mention in the same sentence */
true if the name of entity precedes (or is) mention in the same sentence
true if the name of entity precedes ( or is ) mention in the same sentence
bool MentionConfidence::entityNamePrecedesMentInSentence(const Mention* ment, const Entity *ent, const EntitySet *entitySet, const MentionSet* mentionSet){
	if (ment->getMentionType() == Mention::NAME) 
		return true;
	int ment_token = ment->getNode()->getStartToken();
	for (int m = 0; m < mentionSet->getNMentions(); m++) {
		const Mention *other_ment = mentionSet->getMention(m);
		const Entity *other_ent = entitySet->getEntityByMention(other_ment->getUID());
		if ((other_ment->getMentionType() != Mention::NAME) || (!other_ent) ||
			(ent->getID() != other_ent->getID()))
			continue;
		if (other_ment->getNode()->getEndToken() < ment_token) 
			return true;
	}
	return false;
}
bool MentionConfidence :: entityNamePrecedesMentInSentence ( const Mention * ment , const Entity * ent , const EntitySet * entitySet , const MentionSet * mentionSet ) { if ( ment -> getMentionType ( ) == Mention :: NAME ) return true ; int ment_token = ment -> getNode ( ) -> getStartToken ( ) ; for ( int m = 0 ; m < mentionSet -> getNMentions ( ) ; m ++ ) { const Mention * other_ment = mentionSet -> getMention ( m ) ; const Entity * other_ent = entitySet -> getEntityByMention ( other_ment -> getUID ( ) ) ; if ( ( other_ment -> getMentionType ( ) != Mention :: NAME ) || ( ! other_ent ) || ( ent -> getID ( ) != other_ent -> getID ( ) ) ) continue ; if ( other_ment -> getNode ( ) -> getEndToken ( ) < ment_token ) return true ; } return false ; }
true if the name of entity precedes (or is) mention in the same sentence
true if the name of entity precedes ( or is ) mention in the same sentence