src/Generic/actors/LocationMentionResolver.cpp
// Get all possible gazetteer resolutions from a particular country

Get all possible gazetteer resolutions from a particular country
Get all possible gazetteer resolutions from a particular country
std::vector<Gazetteer::GeoResolution_ptr> LocationMentionResolver::getAllResolutionsInCountry(std::vector<std::wstring>& canonicalNames, const Symbol countryCode) const {
	for(std::vector<std::wstring>::iterator iter = canonicalNames.begin(); iter != canonicalNames.end(); iter++) {
		std::vector<Gazetteer::GeoResolution_ptr> result;	
		std::vector<Gazetteer::GeoResolution_ptr> resolutions = _gazetteer->geonameLookup(*iter);
		BOOST_FOREACH(Gazetteer::GeoResolution_ptr candidateResolution, resolutions) {
			if (candidateResolution->countrycode == countryCode) 
				result.push_back(candidateResolution);
		}
		if (!result.empty())
			return result;
	}
	return std::vector<Gazetteer::GeoResolution_ptr>();
}
std :: vector < Gazetteer :: GeoResolution_ptr > LocationMentionResolver :: getAllResolutionsInCountry ( std :: vector < std :: wstring > & canonicalNames , const Symbol countryCode ) const { for ( std :: vector < std :: wstring > :: iterator iter = canonicalNames . begin ( ) ; iter != canonicalNames . end ( ) ; iter ++ ) { std :: vector < Gazetteer :: GeoResolution_ptr > result ; std :: vector < Gazetteer :: GeoResolution_ptr > resolutions = _gazetteer -> geonameLookup ( * iter ) ; BOOST_FOREACH ( Gazetteer :: GeoResolution_ptr candidateResolution , resolutions ) { if ( candidateResolution -> countrycode == countryCode ) result . push_back ( candidateResolution ) ; } if ( ! result . empty ( ) ) return result ; } return std :: vector < Gazetteer :: GeoResolution_ptr > ( ) ; }
Get all possible gazetteer resolutions from a particular country
Get all possible gazetteer resolutions from a particular country