src/Generic/patterns/PropPattern.cpp
// returns all proposition matches in the sentence

returns all proposition matches in the sentence
returns all proposition matches in the sentence
PatternFeatureSet_ptr PropPattern::matchesSentence(PatternMatcher_ptr patternMatcher, SentenceTheory *sTheory, UTF8OutputStream *debug) {
	if (_languageVariant && !patternMatcher->getActiveLanguageVariant()->matchesConstraint(*_languageVariant)) {
		return matchesAlignedSentence(patternMatcher, sTheory, _languageVariant); 
	}
	PatternFeatureSet_ptr allSentenceProps = boost::make_shared<PatternFeatureSet>();
	bool matched = false;
	PropositionSet *propSet = sTheory->getPropositionSet();
	std::vector<float> scores;
	for (int i = 0; i < propSet->getNPropositions(); i++) {
		if (debug != 0) {
		}
		PatternFeatureSet_ptr sfs = matchesProp(patternMatcher, 
			sTheory->getTokenSequence()->getSentenceNumber(), 
			propSet->getProposition(i), false, PropStatusManager_ptr());
		if (sfs != 0) {
			SessionLogger::dbg("BRANDY") << getDebugID() << " PropPattern matches prop# " << i << "\n";
			if (debug != 0) {
			}
			allSentenceProps->addFeatures(sfs);
			scores.push_back(sfs->getScore());
			matched = true;
		}
	}
	if (matched) {
		allSentenceProps->setScore(ScoringFactory::scoreMax(scores, Pattern::UNSPECIFIED_SCORE));		
		return allSentenceProps;
	} else {
		return PatternFeatureSet_ptr();
	}
}
PatternFeatureSet_ptr PropPattern :: matchesSentence ( PatternMatcher_ptr patternMatcher , SentenceTheory * sTheory , UTF8OutputStream * debug ) { if ( _languageVariant && ! patternMatcher -> getActiveLanguageVariant ( ) -> matchesConstraint ( * _languageVariant ) ) { return matchesAlignedSentence ( patternMatcher , sTheory , _languageVariant ) ; } PatternFeatureSet_ptr allSentenceProps = boost :: make_shared < PatternFeatureSet > ( ) ; bool matched = false ; PropositionSet * propSet = sTheory -> getPropositionSet ( ) ; std :: vector < float > scores ; for ( int i = 0 ; i < propSet -> getNPropositions ( ) ; i ++ ) { if ( debug != 0 ) { } PatternFeatureSet_ptr sfs = matchesProp ( patternMatcher , sTheory -> getTokenSequence ( ) -> getSentenceNumber ( ) , propSet -> getProposition ( i ) , false , PropStatusManager_ptr ( ) ) ; if ( sfs != 0 ) { SessionLogger :: dbg ( " " ) << getDebugID ( ) << " " << i << " \n " ; if ( debug != 0 ) { } allSentenceProps -> addFeatures ( sfs ) ; scores . push_back ( sfs -> getScore ( ) ) ; matched = true ; } } if ( matched ) { allSentenceProps -> setScore ( ScoringFactory :: scoreMax ( scores , Pattern :: UNSPECIFIED_SCORE ) ) ; return allSentenceProps ; } else { return PatternFeatureSet_ptr ( ) ; } }
returns all proposition matches in the sentence
returns all proposition matches in the sentence
//if (i != 4) { continue; }
 //*debug << "      prop " << (i + 1) << "\n";
 //*debug << propSet->getProposition(i)->toString() << "\n";
 //*debug << "        match!\n";
 // just want the best one from this sentence, no fancy combination
