src/Spanish/propositions/es_PropositionStatusClassifier.cpp
/** Add proposition status labels that can't (easily) be added using patterns.
*/
Add proposition status labels that can't (easily) be added using patterns.
Add proposition status labels that can ' t ( easily ) be added using patterns .
void SpanishPropositionStatusClassifier::augmentPropositionTheoryExtras(DocTheory *docTheory, SentenceTheory *sentTheory)
{
	PropositionSet *propSet = sentTheory->getPropositionSet();
	for (int k = 0; k < propSet->getNPropositions(); k++) {
		Proposition *prop = propSet->getProposition(k);
		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() == ifSym ||
					(node->getHeadIndex() == 0 &&
					node->getNChildren() > 1 &&
					node->getChild(1)->getTag() == EnglishSTags::IN &&
					node->getChild(1)->getHeadWord() == ifSym))) 
				{
					prop->addStatus(PropositionStatus::IF);
					break;
				}
				node = node->getParent();
			}
		}
	}
}
void SpanishPropositionStatusClassifier :: augmentPropositionTheoryExtras ( DocTheory * docTheory , SentenceTheory * sentTheory ) { PropositionSet * propSet = sentTheory -> getPropositionSet ( ) ; for ( int k = 0 ; k < propSet -> getNPropositions ( ) ; k ++ ) { Proposition * prop = propSet -> getProposition ( k ) ; 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 ( ) == ifSym || ( node -> getHeadIndex ( ) == 0 && node -> getNChildren ( ) > 1 && node -> getChild ( 1 ) -> getTag ( ) == EnglishSTags :: IN && node -> getChild ( 1 ) -> getHeadWord ( ) == ifSym ) ) ) { prop -> addStatus ( PropositionStatus :: IF ) ; break ; } node = node -> getParent ( ) ; } } } }
Add proposition status labels that can't (easily) be added using patterns.
Add proposition status labels that can ' t ( easily ) be added using patterns .
// typical counter-example:
 // "if he had not worked for IBM, he wouldn't have paid her"
 // can we do anything with this?
 // get "if..." unrepresented in propositions
