src/English/events/en_EventUtilities.cpp
// This function was initially lifted from RelationUtilities, but has been modified

This function was initially lifted from RelationUtilities, but has been modified
This function was initially lifted from RelationUtilities but has been modified
void EnglishEventUtilities::identifyNonAssertedProps(const PropositionSet *propSet, 
													 const MentionSet *mentionSet, 
													 bool *isNonAsserted)
{
	static bool init = false;
	if (!init) {
		init = true;
		std::string filename = ParamReader::getParam("non_asserted_event_indicators");
		if (!filename.empty()) {
			_nonAssertedIndicators = new SymbolHash(filename.c_str());
		} else _nonAssertedIndicators = new SymbolHash(5);
	}
	for (int i = 0; i < propSet->getNPropositions(); i++) {
		isNonAsserted[i] = false;
	}
	for (int k = 0; k < propSet->getNPropositions(); k++) {
		Proposition *prop = propSet->getProposition(k);
		if (prop->getAdverb() && prop->getAdverb()->getHeadWord() == allegedly_sym)
			isNonAsserted[prop->getIndex()] = true;
		const SynNode *modal = prop->getModal();
		if (modal != 0) {
			Symbol modalWord = modal->getHeadWord();
			if (modalWord == EnglishWordConstants::SHOULD ||
				modalWord == EnglishWordConstants::COULD ||
				modalWord == EnglishWordConstants::MIGHT ||
				modalWord == EnglishWordConstants::MAY)
				isNonAsserted[prop->getIndex()] = true;
		}
		for (int j = 0; j < prop->getNArgs(); j++) {
			Argument *arg = prop->getArg(j);
			if (arg->getType() == Argument::PROPOSITION_ARG &&
				(arg->getRoleSym() == EnglishWordConstants::IF || 
				arg->getRoleSym() == EnglishWordConstants::WHETHER))
			{
				isNonAsserted[arg->getProposition()->getIndex()] = true;
			}
		}
		if (prop->getPredType() == Proposition::VERB_PRED) {
			const SynNode* node = prop->getPredHead();
			while (node != 0) {
				if (node->getTag() != EnglishSTags::VP &&
					node->getTag() != EnglishSTags::S &&
					node->getTag() != EnglishSTags::SBAR &&
					!node->isPreterminal())
					break;
				if (node->getTag() == EnglishSTags::SBAR &&
					(node->getHeadWord() == EnglishWordConstants::IF ||
					(node->getHeadIndex() == 0 &&
					node->getNChildren() > 1 &&
					node->getChild(1)->getTag() == EnglishSTags::IN &&
					node->getChild(1)->getHeadWord() == EnglishWordConstants::IF)))
				{
					isNonAsserted[prop->getIndex()] = true;
					break;
				}
				node = node->getParent();								
			}
		}
	}
	for (int l = 0; l < propSet->getNPropositions(); l++) {
		Proposition *prop = propSet->getProposition(l);
		Symbol predicate = prop->getPredSymbol();
		if (predicate.is_null())
			continue;
		Symbol stemmed_predicate = WordNet::getInstance()->stem_verb(predicate);
		if (_nonAssertedIndicators->lookup(stemmed_predicate) ||
			(isNonAsserted[prop->getIndex()] && prop->getPredType() == Proposition::VERB_PRED))
		{
			for (int j = 0; j < prop->getNArgs(); j++) {
				Argument *arg = prop->getArg(j);
				if (arg->getType() == Argument::PROPOSITION_ARG &&
					(arg->getRoleSym() == Argument::OBJ_ROLE ||
					 arg->getRoleSym() == EnglishWordConstants::THAT ||
					 arg->getRoleSym() == Argument::IOBJ_ROLE))					  
				{
					isNonAsserted[arg->getProposition()->getIndex()] = true;
				}
			}
		}
	}
}
void EnglishEventUtilities :: identifyNonAssertedProps ( const PropositionSet * propSet , const MentionSet * mentionSet , bool * isNonAsserted ) { static bool init = false ; if ( ! init ) { init = true ; std :: string filename = ParamReader :: getParam ( " " ) ; if ( ! filename . empty ( ) ) { _nonAssertedIndicators = new SymbolHash ( filename . c_str ( ) ) ; } else _nonAssertedIndicators = new SymbolHash ( 5 ) ; } for ( int i = 0 ; i < propSet -> getNPropositions ( ) ; i ++ ) { isNonAsserted [ i ] = false ; } for ( int k = 0 ; k < propSet -> getNPropositions ( ) ; k ++ ) { Proposition * prop = propSet -> getProposition ( k ) ; if ( prop -> getAdverb ( ) && prop -> getAdverb ( ) -> getHeadWord ( ) == allegedly_sym ) isNonAsserted [ prop -> getIndex ( ) ] = true ; const SynNode * modal = prop -> getModal ( ) ; if ( modal != 0 ) { Symbol modalWord = modal -> getHeadWord ( ) ; if ( modalWord == EnglishWordConstants :: SHOULD || modalWord == EnglishWordConstants :: COULD || modalWord == EnglishWordConstants :: MIGHT || modalWord == EnglishWordConstants :: MAY ) isNonAsserted [ prop -> getIndex ( ) ] = true ; } for ( int j = 0 ; j < prop -> getNArgs ( ) ; j ++ ) { Argument * arg = prop -> getArg ( j ) ; if ( arg -> getType ( ) == Argument :: PROPOSITION_ARG && ( arg -> getRoleSym ( ) == EnglishWordConstants :: IF || arg -> getRoleSym ( ) == EnglishWordConstants :: WHETHER ) ) { isNonAsserted [ arg -> getProposition ( ) -> getIndex ( ) ] = true ; } } if ( prop -> getPredType ( ) == Proposition :: VERB_PRED ) { const SynNode * node = prop -> getPredHead ( ) ; while ( node != 0 ) { if ( node -> getTag ( ) != EnglishSTags :: VP && node -> getTag ( ) != EnglishSTags :: S && node -> getTag ( ) != EnglishSTags :: SBAR && ! node -> isPreterminal ( ) ) break ; if ( node -> getTag ( ) == EnglishSTags :: SBAR && ( node -> getHeadWord ( ) == EnglishWordConstants :: IF || ( node -> getHeadIndex ( ) == 0 && node -> getNChildren ( ) > 1 && node -> getChild ( 1 ) -> getTag ( ) == EnglishSTags :: IN && node -> getChild ( 1 ) -> getHeadWord ( ) == EnglishWordConstants :: IF ) ) ) { isNonAsserted [ prop -> getIndex ( ) ] = true ; break ; } node = node -> getParent ( ) ; } } } for ( int l = 0 ; l < propSet -> getNPropositions ( ) ; l ++ ) { Proposition * prop = propSet -> getProposition ( l ) ; Symbol predicate = prop -> getPredSymbol ( ) ; if ( predicate . is_null ( ) ) continue ; Symbol stemmed_predicate = WordNet :: getInstance ( ) -> stem_verb ( predicate ) ; if ( _nonAssertedIndicators -> lookup ( stemmed_predicate ) || ( isNonAsserted [ prop -> getIndex ( ) ] && prop -> getPredType ( ) == Proposition :: VERB_PRED ) ) { for ( int j = 0 ; j < prop -> getNArgs ( ) ; j ++ ) { Argument * arg = prop -> getArg ( j ) ; if ( arg -> getType ( ) == Argument :: PROPOSITION_ARG && ( arg -> getRoleSym ( ) == Argument :: OBJ_ROLE || arg -> getRoleSym ( ) == EnglishWordConstants :: THAT || arg -> getRoleSym ( ) == Argument :: IOBJ_ROLE ) ) { isNonAsserted [ arg -> getProposition ( ) -> getIndex ( ) ] = true ; } } } } }
This function was initially lifted from RelationUtilities, but has been modified
This function was initially lifted from RelationUtilities but has been modified
// allegedly
 // should, could, might, may
 // if/whether: p#
 // not ALWAYS accurate, but close enough		
 // get "if..." unrepresented in propositions
 // [non-asserted prop] that: p# -- e.g. he might plan an attack
 // ... but only allow verbs, no modifiers, e.g. he might be happy that...
 // OR
 // [non-asserted word] that: p# -- he guessed that X
