src/PredFinder/common/ElfMultiDoc.cpp
/**
 * Traverses a DocIdAndTypeToSRMMap, each element of which maps from a (doc ID, ontology type str)
 * pair to a map of value string replacements, each of which, in turn, maps from a name to a URI. 
 * Also traverses a DocIdAndTypeToSRMMap, each element of which maps from an ontology type str
 * to a map of value string replacements. 
 * Fills three static maps, one of which (_name_docid_to_bound_uris) maps from a (name, doc ID) pair to a bound URI, 
 * one of which (_name_to_bound_uris) maps from a name to a bound URI, 
 * and the third of which (_bound_uri_to_types) maps from a bound URI to a set of types. Both the original name and the 
 * normalized name are used to create mappings in the first two maps (though when the normalized name equals 
 * the original name, only one entry ends up being added).
 * 
 **/
Traverses a DocIdAndTypeToSRMMap, each element of which maps from a (doc ID, ontology type str)
pair to a map of value string replacements, each of which, in turn, maps from a name to a URI.
Also traverses a DocIdAndTypeToSRMMap, each element of which maps from an ontology type str
to a map of value string replacements.
Fills three static maps, one of which (_name_docid_to_bound_uris) maps from a (name, doc ID) pair to a bound URI,
one of which (_name_to_bound_uris) maps from a name to a bound URI,
and the third of which (_bound_uri_to_types) maps from a bound URI to a set of types. Both the original name and the
normalized name are used to create mappings in the first two maps (though when the normalized name equals
the original name, only one entry ends up being added).
Traverses a DocIdAndTypeToSRMMap each element of which maps from a ( doc ID ontology type str ) pair to a map of value string replacements each of which in turn maps from a name to a URI . Also traverses a DocIdAndTypeToSRMMap each element of which maps from an ontology type str to a map of value string replacements . Fills three static maps one of which ( _name_docid_to_bound_uris ) maps from a ( name doc ID ) pair to a bound URI one of which ( _name_to_bound_uris ) maps from a name to a bound URI and the third of which ( _bound_uri_to_types ) maps from a bound URI to a set of types . Both the original name and the normalized name are used to create mappings in the first two maps ( though when the normalized name equals the original name only one entry ends up being added ) .
void ElfMultiDoc::generate_typeless_maps(){
	BOOST_FOREACH(DocIdAndTypeToSRMMap::value_type entry, _docid_type_to_srm) {
		std::wstring doc_id = entry.first.first;
		std::wstring type = entry.first.second;
		StringReplacementMap srm = entry.second;
		BOOST_FOREACH(StringReplacementMap::value_type replace, srm){
			std::wstring name = replace.first;
			std::wstring uri = replace.second;
			_name_docid_to_bound_uris[std::pair<std::wstring, std::wstring>(name, doc_id)].insert(uri);
			std::wstring normalized_string = UnicodeUtil::normalizeTextString(name);
			_name_docid_to_bound_uris[std::pair<std::wstring, std::wstring>(normalized_string, doc_id)].insert(uri);
			_bound_uri_to_types[uri].insert(type);
		}
	}
	BOOST_FOREACH(TypeToSRMMap::value_type entry, _type_to_srm) {
		std::wstring type = entry.first;
		StringReplacementMap srm = entry.second;
		BOOST_FOREACH(StringReplacementMap::value_type replace, srm){
			std::wstring name = replace.first;
			std::wstring uri = replace.second;
			_name_to_bound_uris[name].insert(uri);
			std::wstring normalized_string = UnicodeUtil::normalizeTextString(name);
			_name_to_bound_uris[normalized_string].insert(uri);
			_bound_uri_to_types[uri].insert(type);
		}
	}
}
void ElfMultiDoc :: generate_typeless_maps ( ) { BOOST_FOREACH ( DocIdAndTypeToSRMMap :: value_type entry , _docid_type_to_srm ) { std :: wstring doc_id = entry . first . first ; std :: wstring type = entry . first . second ; StringReplacementMap srm = entry . second ; BOOST_FOREACH ( StringReplacementMap :: value_type replace , srm ) { std :: wstring name = replace . first ; std :: wstring uri = replace . second ; _name_docid_to_bound_uris [ std :: pair < std :: wstring , std :: wstring > ( name , doc_id ) ] . insert ( uri ) ; std :: wstring normalized_string = UnicodeUtil :: normalizeTextString ( name ) ; _name_docid_to_bound_uris [ std :: pair < std :: wstring , std :: wstring > ( normalized_string , doc_id ) ] . insert ( uri ) ; _bound_uri_to_types [ uri ] . insert ( type ) ; } } BOOST_FOREACH ( TypeToSRMMap :: value_type entry , _type_to_srm ) { std :: wstring type = entry . first ; StringReplacementMap srm = entry . second ; BOOST_FOREACH ( StringReplacementMap :: value_type replace , srm ) { std :: wstring name = replace . first ; std :: wstring uri = replace . second ; _name_to_bound_uris [ name ] . insert ( uri ) ; std :: wstring normalized_string = UnicodeUtil :: normalizeTextString ( name ) ; _name_to_bound_uris [ normalized_string ] . insert ( uri ) ; _bound_uri_to_types [ uri ] . insert ( type ) ; } } }
Traverses a DocIdAndTypeToSRMMap, each element of which maps from a (doc ID, ontology type str)
 pair to a map of value string replacements, each of which, in turn, maps from a name to a URI.
Traverses a DocIdAndTypeToSRMMap each element of which maps from a ( doc ID ontology type str ) pair to a map of value string replacements each of which in turn maps from a name to a URI .
// Loop over document-specific entries
 //create a normalized, lowercased version of the name and add it
 // Loop over non-document-specific entries
 //create a normalized, lowercased version of the name and add it
