src/Generic/theories/MentionConfidence.cpp
/* true if mention appears in the sentence and has the role that matches the requested role
*/
true if mention appears in the sentence and has the role that matches the requested role
true if mention appears in the sentence and has the role that matches the requested role
bool MentionConfidence::isMentInSentWithArgRole(const Mention *ment, const DocTheory *docTheory, Symbol role, int sent_no){
	const SentenceTheory *sentTheory = docTheory->getSentenceTheory(sent_no);
	const MentionSet *mentionSet = sentTheory->getMentionSet();
	const PropositionSet *propSet = sentTheory->getPropositionSet();
	for (int p = 0; p < propSet->getNPropositions(); p++) {
		const Proposition* prop = propSet->getProposition(p);
		for (int a = 0; a < prop->getNArgs(); a++) {
			if (prop->getArg(a)->getRoleSym() == role) {
				const Argument *arg = prop->getArg(a);
				if (arg->getType() != Argument::MENTION_ARG)
					continue;
				const Mention *arg_ment = arg->getMention(mentionSet);
				if (arg_ment->getUID() == ment->getUID())
					return true;
			}
		}
	}
	return false;
}
bool MentionConfidence :: isMentInSentWithArgRole ( const Mention * ment , const DocTheory * docTheory , Symbol role , int sent_no ) { const SentenceTheory * sentTheory = docTheory -> getSentenceTheory ( sent_no ) ; const MentionSet * mentionSet = sentTheory -> getMentionSet ( ) ; const PropositionSet * propSet = sentTheory -> getPropositionSet ( ) ; for ( int p = 0 ; p < propSet -> getNPropositions ( ) ; p ++ ) { const Proposition * prop = propSet -> getProposition ( p ) ; for ( int a = 0 ; a < prop -> getNArgs ( ) ; a ++ ) { if ( prop -> getArg ( a ) -> getRoleSym ( ) == role ) { const Argument * arg = prop -> getArg ( a ) ; if ( arg -> getType ( ) != Argument :: MENTION_ARG ) continue ; const Mention * arg_ment = arg -> getMention ( mentionSet ) ; if ( arg_ment -> getUID ( ) == ment -> getUID ( ) ) return true ; } } } return false ; }
true if mention appears in the sentence and has the role that matches the requested role
true if mention appears in the sentence and has the role that matches the requested role