src/Generic/patterns/PatternSet.cpp
/**
 * Uses a PatternSet to build an IDToPatternReturnVecSeqMap, 
 * which maps a pattern id name to a PatternReturnVecSeqMap, which stores
 * any of the possible bundles of information used to represent all the args
 * for a given top-level pattern. Usually, there is only one such bundle, but
 * if the pattern contains an any-of, there will be more. If it contains multiple
 * any-ofs, there could be many more. 
 *
 * @param output_map IDToPatternReturnVecSeqMap to be filled with non-tbd PatternReturns if no tbd pattern 
 * is encountered.
 * @param output_tbd_predicates Names of tbd predicates
 * derived from the "tbd" ReturnPatterns encountered (other than "tbd agent" and "tbd patient").
 * @param dump Determines whether pattern output (which is verbose)
 * should be dumped.
 *
 * @see http://wiki.d4m.bbn.com/wiki/PatternReturn_Hierarchy
 *
 * @author afrankel@bbn.com
 * @date 2010.10.18
 **/
Uses a PatternSet to build an IDToPatternReturnVecSeqMap,
which maps a pattern id name to a PatternReturnVecSeqMap, which stores
any of the possible bundles of information used to represent all the args
for a given top-level pattern. Usually, there is only one such bundle, but
if the pattern contains an any-of, there will be more. If it contains multiple
any-ofs, there could be many more.

@param output_map IDToPatternReturnVecSeqMap to be filled with non-tbd PatternReturns if no tbd pattern
is encountered.




Uses a PatternSet to build an IDToPatternReturnVecSeqMap which maps a pattern id name to a PatternReturnVecSeqMap which stores any of the possible bundles of information used to represent all the args for a given top - level pattern . Usually there is only one such bundle but if the pattern contains an any - of there will be more . If it contains multiple any - ofs there could be many more . @param output_map IDToPatternReturnVecSeqMap to be filled with non - tbd PatternReturns if no tbd pattern is encountered .
void PatternSet::getPatternReturns(IDToPatternReturnVecSeqMap & output_map, bool dump) const 
{
	if (dump) {
		SessionLogger::info("ps_0") << "PATTERN: " << getPatternSetName().to_debug_string();
	}
	size_t n_toplevel_patterns = _topLevelPatterns.size();
	for (size_t n = 0; n < n_toplevel_patterns; ++n) {
		if (_topLevelPatterns[n]) {
			if (_topLevelPatterns[n]->getFirstValidID().is_null()) {
				continue;
			}
			if (dump) {
				std::ostringstream ostr;
				ostr << "  ID: " << _topLevelPatterns[n]->getFirstValidID().to_debug_string() << std::endl;
				_topLevelPatterns[n]->dump(ostr, 0);
				SessionLogger::info("ps_1") << ostr.str();
			}
			PatternReturnVecSeq pattern_return_vec_seq;
			_topLevelPatterns[n]->getReturns(pattern_return_vec_seq);
			output_map.insert(make_pair(_topLevelPatterns[n]->getFirstValidID(), pattern_return_vec_seq));
			int size_after(static_cast<int>(output_map.size()));
			if (dump) {
				std::ostringstream ostr;
				dumpPatternReturnVecSeq(pattern_return_vec_seq, ostr, 0);
				SessionLogger::info("ps_2") << ostr.str();
			}
		}
	}
	return;
}
void PatternSet :: getPatternReturns ( IDToPatternReturnVecSeqMap & output_map , bool dump ) const { if ( dump ) { SessionLogger :: info ( " " ) << " " << getPatternSetName ( ) . to_debug_string ( ) ; } size_t n_toplevel_patterns = _topLevelPatterns . size ( ) ; for ( size_t n = 0 ; n < n_toplevel_patterns ; ++ n ) { if ( _topLevelPatterns [ n ] ) { if ( _topLevelPatterns [ n ] -> getFirstValidID ( ) . is_null ( ) ) { continue ; } if ( dump ) { std :: ostringstream ostr ; ostr << " " << _topLevelPatterns [ n ] -> getFirstValidID ( ) . to_debug_string ( ) << std :: endl ; _topLevelPatterns [ n ] -> dump ( ostr , 0 ) ; SessionLogger :: info ( " " ) << ostr . str ( ) ; } PatternReturnVecSeq pattern_return_vec_seq ; _topLevelPatterns [ n ] -> getReturns ( pattern_return_vec_seq ) ; output_map . insert ( make_pair ( _topLevelPatterns [ n ] -> getFirstValidID ( ) , pattern_return_vec_seq ) ) ; int size_after ( static_cast < int > ( output_map . size ( ) ) ) ; if ( dump ) { std :: ostringstream ostr ; dumpPatternReturnVecSeq ( pattern_return_vec_seq , ostr , 0 ) ; SessionLogger :: info ( " " ) << ostr . str ( ) ; } } } return ; }
Uses a PatternSet to build an IDToPatternReturnVecSeqMap,
 which maps a pattern id name to a PatternReturnVecSeqMap, which stores
 any of the possible bundles of information used to represent all the args
 for a given top-level pattern.
Uses a PatternSet to build an IDToPatternReturnVecSeqMap which maps a pattern id name to a PatternReturnVecSeqMap which stores any of the possible bundles of information used to represent all the args for a given top - level pattern .
// We're probably dealing with a pattern that produces an individual
 // and hence doesn't need an ID. Just skip the pattern.
