src/Generic/actors/LocationMentionResolver.cpp
// Get all possible resolutions from gazetteer table (NOT countries table)

Get all possible resolutions from gazetteer table (NOT countries table)
Get all possible resolutions from gazetteer table ( NOT countries table )
std::map<Symbol, Gazetteer::GeoResolution_ptr> LocationMentionResolver::getAllPossibleResolutionsOnePerCountry(std::vector<std::wstring>& canonicalNames) const {
	std::vector<Gazetteer::GeoResolution_ptr> resolutions = getBestResolutionSetForCanonicalNames(canonicalNames);
	std::map<Symbol, Gazetteer::GeoResolution_ptr> best_country_resolutions;
	BOOST_FOREACH(Gazetteer::GeoResolution_ptr candidateResolution, resolutions) {
		size_t population = candidateResolution->population;
		Symbol country = SymbolConstants::nullSymbol;
		if (candidateResolution->countryInfo)
			country = candidateResolution->countryInfo->isoCode;
		if (best_country_resolutions[country] == Gazetteer::GeoResolution_ptr() || population > best_country_resolutions[country]->population)
			best_country_resolutions[country] = candidateResolution;	
	}
	return best_country_resolutions;
}
std :: map < Symbol , Gazetteer :: GeoResolution_ptr > LocationMentionResolver :: getAllPossibleResolutionsOnePerCountry ( std :: vector < std :: wstring > & canonicalNames ) const { std :: vector < Gazetteer :: GeoResolution_ptr > resolutions = getBestResolutionSetForCanonicalNames ( canonicalNames ) ; std :: map < Symbol , Gazetteer :: GeoResolution_ptr > best_country_resolutions ; BOOST_FOREACH ( Gazetteer :: GeoResolution_ptr candidateResolution , resolutions ) { size_t population = candidateResolution -> population ; Symbol country = SymbolConstants :: nullSymbol ; if ( candidateResolution -> countryInfo ) country = candidateResolution -> countryInfo -> isoCode ; if ( best_country_resolutions [ country ] == Gazetteer :: GeoResolution_ptr ( ) || population > best_country_resolutions [ country ] -> population ) best_country_resolutions [ country ] = candidateResolution ; } return best_country_resolutions ; }
Get all possible resolutions from gazetteer table (NOT countries table)
Get all possible resolutions from gazetteer table ( NOT countries table )