src/PredFinder/common/ElfMultiDoc.cpp
/**
 * Given an ACE entity type and a name string, returns an XDoc (cluster) ID.
 * @param entity_type ACE entity type (e.g., "PER", "ORG")
 * @param name_string Name (which will be normalized internally to the method)
 * @return XDoc (cluster) ID
 * @example get_xdoc_id("GPE", "aden") -> "bbn:xdoc-517"
 **/
Given an ACE entity type and a name string, returns an XDoc (cluster) ID.
Given an ACE entity type and a name string returns an XDoc ( cluster ) ID .
XDocIdType ElfMultiDoc::get_xdoc_id(const Symbol & entity_type, const std::wstring & name_string) {
    XDocIdType ret;
	if (!ElfMultiDoc::_initialized_entity_type_and_name_to_xdoc_id)
		throw std::runtime_error("ElfMultiDoc::get_xdoc_id(Symbol, std::wstring): "
		"static method called before table is initialized");
	std::wstring normalized_string = UnicodeUtil::normalizeTextString(name_string);
	EntityTypeAndNamePairToXDocIdMap::iterator cluster_i = ElfMultiDoc::_entity_type_and_name_to_xdoc_id.find(
		EntityTypeAndNamePairToXDocIdMap::key_type(entity_type, normalized_string));
	if (cluster_i != ElfMultiDoc::_entity_type_and_name_to_xdoc_id.end()) {
		if ((cluster_i->second).is_valid()) {
			ret = cluster_i->second;
		}
	}
	return ret;
}
XDocIdType ElfMultiDoc :: get_xdoc_id ( const Symbol & entity_type , const std :: wstring & name_string ) { XDocIdType ret ; if ( ! ElfMultiDoc :: _initialized_entity_type_and_name_to_xdoc_id ) throw std :: runtime_error ( " " " " ) ; std :: wstring normalized_string = UnicodeUtil :: normalizeTextString ( name_string ) ; EntityTypeAndNamePairToXDocIdMap :: iterator cluster_i = ElfMultiDoc :: _entity_type_and_name_to_xdoc_id . find ( EntityTypeAndNamePairToXDocIdMap :: key_type ( entity_type , normalized_string ) ) ; if ( cluster_i != ElfMultiDoc :: _entity_type_and_name_to_xdoc_id . end ( ) ) { if ( ( cluster_i -> second ) . is_valid ( ) ) { ret = cluster_i -> second ; } } return ret ; }
Given an ACE entity type and a name string, returns an XDoc (cluster) ID.
Given an ACE entity type and a name string returns an XDoc ( cluster ) ID .
// Make sure the string to cluster map is initialized
 // Normalize the name string
 // Find a matching XDoc ID for this type and name, if any
 //SessionLogger::info("LEARNIT") << "Mapped <" << entity_type << ", " << name_string << "> "
 // "to <" << cluster_i->second << ">." << std::endl;
