src/PredFinder/inference/EIUtils.cpp
/** TODO: this may be somewhat too aggressive. **/
this may be somewhat too aggressive.
this may be somewhat too aggressive .
bool EIUtils::isPoliticalParty(EIDocData_ptr docData, const Entity* e){
	const EntitySet* es = docData->getDocTheory()->getEntitySet();
	for (int i=0; i<e->getNMentions(); ++i) {
		const Mention *ment = es->getMention(e->getMention(i));
		const SynNode* mentNode = ment->getAtomicHead();
		if (mentNode) {
			Symbol hd = mentNode->getHeadWord();
			if (hd == Symbol(L"un") || hd == Symbol(L"u.n.")) {
				return false;
			}
			const std::wstring mentText = mentNode->toTextString();
			if (mentText.find(L"party") != std::wstring::npos) {
				return true;
			}
			if (EIUtils::isPartyNameWord(mentNode->getHeadWord())) {
				return true;
			}
		}	
	}
	return false;
}
bool EIUtils :: isPoliticalParty ( EIDocData_ptr docData , const Entity * e ) { const EntitySet * es = docData -> getDocTheory ( ) -> getEntitySet ( ) ; for ( int i = 0 ; i < e -> getNMentions ( ) ; ++ i ) { const Mention * ment = es -> getMention ( e -> getMention ( i ) ) ; const SynNode * mentNode = ment -> getAtomicHead ( ) ; if ( mentNode ) { Symbol hd = mentNode -> getHeadWord ( ) ; if ( hd == Symbol ( L" " ) || hd == Symbol ( L" " ) ) { return false ; } const std :: wstring mentText = mentNode -> toTextString ( ) ; if ( mentText . find ( L" " ) != std :: wstring :: npos ) { return true ; } if ( EIUtils :: isPartyNameWord ( mentNode -> getHeadWord ( ) ) ) { return true ; } } } return false ; }
TODO: this may be somewhat too aggressive.
TODO : this may be somewhat too aggressive .
// United Nations is not a political party
