src/PredFinder/elf/ElfDocument.cpp
// For each active LearnIt pattern, look for matches in this document

For each active LearnIt pattern, look for matches in this document
For each active LearnIt pattern look for matches in this document
BOOST_FOREACH(LearnItPattern_ptr pattern, learnit_patterns) {
	    for (int sent_index = 0; sent_index < docData->getNSentences(); sent_index++) {
	        SentenceTheory* sent_theory = docData->getSentenceTheory(sent_index);
            MatchInfo::PatternMatches matches = MatchInfo::findPatternInSentence(docData->getDocTheory(), 
				sent_theory, pattern);
            BOOST_FOREACH(MatchInfo::PatternMatch match, matches) {
				try {
					ElfRelation_ptr relation = boost::make_shared<ElfRelation>(
						docData->getDocTheory(), sent_theory,
						pattern->getTarget(), match, pattern->precision());
					addTemporalAttributes(temporalAttributeAdder, relation,
							docData, sent_index);
					_relations.insert(relation);
				} catch (UnexpectedInputException& error) {
					SessionLogger::info("LEARNIT") << pattern->getName() << " failed to create relation" << std::endl;
					if ((error.getSource() && strlen(error.getSource()) > 0) || 
						(error.getMessage() && strlen(error.getMessage()) > 0)) {
						SessionLogger::info("LEARNIT") << "    " << error.getSource() << ": " << error.getMessage() << std::endl;
					}
				}
            }
        }
	}
BOOST_FOREACH ( LearnItPattern_ptr pattern , learnit_patterns ) { for ( int sent_index = 0 ; sent_index < docData -> getNSentences ( ) ; sent_index ++ ) { SentenceTheory * sent_theory = docData -> getSentenceTheory ( sent_index ) ; MatchInfo :: PatternMatches matches = MatchInfo :: findPatternInSentence ( docData -> getDocTheory ( ) , sent_theory , pattern ) ; BOOST_FOREACH ( MatchInfo :: PatternMatch match , matches ) { try { ElfRelation_ptr relation = boost :: make_shared < ElfRelation > ( docData -> getDocTheory ( ) , sent_theory , pattern -> getTarget ( ) , match , pattern -> precision ( ) ) ; addTemporalAttributes ( temporalAttributeAdder , relation , docData , sent_index ) ; _relations . insert ( relation ) ; } catch ( UnexpectedInputException & error ) { SessionLogger :: info ( " " ) << pattern -> getName ( ) << " " << std :: endl ; if ( ( error . getSource ( ) && strlen ( error . getSource ( ) ) > 0 ) || ( error . getMessage ( ) && strlen ( error . getMessage ( ) ) > 0 ) ) { SessionLogger :: info ( " " ) << " " << error . getSource ( ) << " " << error . getMessage ( ) << std :: endl ; } } } } }
For each active LearnIt pattern, look for matches in this document
For each active LearnIt pattern look for matches in this document
// Look for matches in each sentence
 // Get the theory for this sentence
 // Look at all of the matches for this LearnIt pattern in this sentence by pattern match
 // Create a new relation for this match
