src/LearnIt/MatchInfo.cpp
// Get information about a specific proposition.

Get information about a specific proposition.
Get information about a specific proposition .
void MatchInfo::propInfo(learnit::SeedInstanceMatch* out, const SentenceTheory *sentTheory, 
								 Proposition *prop, Target_ptr target,
								 std::map<int, SlotFiller_ptr> slotFillers, bool lexicalize) {
	std::map<int, std::vector<PropPath> > pathsToSlots;
	typedef std::pair<int, SlotFiller_ptr> SlotFillerPair; 
	BOOST_FOREACH(SlotFillerPair slotFillerPair, slotFillers) {
		int slot_num = slotFillerPair.first;
		SlotFiller_ptr slotFiller = slotFillerPair.second;
		findPropPaths(sentTheory, prop, slotFiller, PropPath(), pathsToSlots[slot_num]);
		if (pathsToSlots[slot_num].size() == 0) {
			return;
		}
	}
	typedef std::pair<int, std::vector<PropPath> > SlotAndPropPaths;
	std::vector<SlotPathMap> slotPathCombinations;
	slotPathCombinations.push_back(std::map<int, PropPath>());
	BOOST_FOREACH(SlotAndPropPaths slotAndPropPaths, pathsToSlots) {
		int slot_num = slotAndPropPaths.first;
		std::vector<PropPath> pathsToSlot = slotAndPropPaths.second;
		std::vector<SlotPathMap> newCombinations;
		BOOST_FOREACH(SlotPathMap partialSlotPaths, slotPathCombinations) {
			BOOST_FOREACH(PropPath pathToSlot, pathsToSlot) {
				SlotPathMap slotPaths(partialSlotPaths); 
				slotPaths[slot_num] = pathToSlot;
				newCombinations.push_back(slotPaths);
			}
		}
		slotPathCombinations.swap(newCombinations);
	}
	if( lexicalize ) {
		lexicalizeCombinations(sentTheory, slotPathCombinations);
	}
	BOOST_FOREACH(SlotPathMap slotPaths, slotPathCombinations) {
		writePropInfoFromSlotPaths(slotPaths, out);
	}
}
void MatchInfo :: propInfo ( learnit :: SeedInstanceMatch * out , const SentenceTheory * sentTheory , Proposition * prop , Target_ptr target , std :: map < int , SlotFiller_ptr > slotFillers , bool lexicalize ) { std :: map < int , std :: vector < PropPath > > pathsToSlots ; typedef std :: pair < int , SlotFiller_ptr > SlotFillerPair ; BOOST_FOREACH ( SlotFillerPair slotFillerPair , slotFillers ) { int slot_num = slotFillerPair . first ; SlotFiller_ptr slotFiller = slotFillerPair . second ; findPropPaths ( sentTheory , prop , slotFiller , PropPath ( ) , pathsToSlots [ slot_num ] ) ; if ( pathsToSlots [ slot_num ] . size ( ) == 0 ) { return ; } } typedef std :: pair < int , std :: vector < PropPath > > SlotAndPropPaths ; std :: vector < SlotPathMap > slotPathCombinations ; slotPathCombinations . push_back ( std :: map < int , PropPath > ( ) ) ; BOOST_FOREACH ( SlotAndPropPaths slotAndPropPaths , pathsToSlots ) { int slot_num = slotAndPropPaths . first ; std :: vector < PropPath > pathsToSlot = slotAndPropPaths . second ; std :: vector < SlotPathMap > newCombinations ; BOOST_FOREACH ( SlotPathMap partialSlotPaths , slotPathCombinations ) { BOOST_FOREACH ( PropPath pathToSlot , pathsToSlot ) { SlotPathMap slotPaths ( partialSlotPaths ) ; slotPaths [ slot_num ] = pathToSlot ; newCombinations . push_back ( slotPaths ) ; } } slotPathCombinations . swap ( newCombinations ) ; } if ( lexicalize ) { lexicalizeCombinations ( sentTheory , slotPathCombinations ) ; } BOOST_FOREACH ( SlotPathMap slotPaths , slotPathCombinations ) { writePropInfoFromSlotPaths ( slotPaths , out ) ; } }
Get information about a specific proposition.
Get information about a specific proposition .
// For each slot, get a vector containing all paths to the corresponding slot filler.
 // If there are no paths to any single slot filler, then give up (return "").
 // Some typedefs used for finding combinations of paths:
 // Find all combinations of the paths.  Each combination is encoded as a slot->path
 // map.  Thus, the list of all combinations is a vector of SlotPathMap.  To find
 // all combinations, we begin with an empty SlotPathMap.  Then, for each slot, we
 // form all combinations of that slot with the combinations we've already found.
 // Make a copy.
 // Swap in the new value for slotPathCombinations.
 //If instructed to lexicalize go through the 
 // Now, generate an XML record for each combination of paths to slot fillers.SE
 // This XML record should merge paths that share links.
 //std::wstringstream out;
 //return out.str();
