private static Map<String, String> loadDemonyms(JsonNode rootNode, UimaMonitor uimaMonitor) { Iterator<JsonNode> iter = rootNode.elements(); demonyms = new HashMap<>(); while (iter.hasNext()) { JsonNode node = iter.next(); String demonym = getProperty(node, "demonym").toLowerCase(); String cca3 = getProperty(node, "cca3").toUpperCase(); if (demonym.isEmpty() || cca3.isEmpty()) { uimaMonitor.warn("Empty demonym or country code found - entry will be skipped"); continue; } demonyms.put(demonym, cca3); } uimaMonitor.info("{} nationalities read", demonyms.size()); return demonyms; }
private static Map<String, String> loadDemonyms(JsonNode rootNode, UimaMonitor uimaMonitor) { Iterator<JsonNode> iter = rootNode.elements(); demonyms = new HashMap<>(); while (iter.hasNext()) { JsonNode node = iter.next(); String demonym = getProperty(node, "demonym").toLowerCase(); String cca3 = getProperty(node, "cca3").toUpperCase(); if (demonym.isEmpty() || cca3.isEmpty()) { uimaMonitor.warn("Empty demonym or country code found - entry will be skipped"); continue; } demonyms.put(demonym, cca3); } uimaMonitor.info("{} nationalities read", demonyms.size()); return demonyms; }
private static Map<String, String> loadCountryNames(JsonNode rootNode, UimaMonitor uimaMonitor) { Iterator<JsonNode> iter = rootNode.elements(); Map<String, String> countryNames = new HashMap<>(); while (iter.hasNext()) { JsonNode node = iter.next(); String cca3 = getProperty(node, "cca3").toUpperCase(); if (node == null || cca3.isEmpty()) { uimaMonitor.warn("Empty country code found - entry will be skipped"); continue; } for (String name : getNames(node.path("name"))) { countryNames.put(name, cca3); } } uimaMonitor.info("{} country names read", countryNames.size()); return countryNames; }
private static Map<String, String> loadCountryNames(JsonNode rootNode, UimaMonitor uimaMonitor) { Iterator<JsonNode> iter = rootNode.elements(); Map<String, String> countryNames = new HashMap<>(); while (iter.hasNext()) { JsonNode node = iter.next(); String cca3 = getProperty(node, "cca3").toUpperCase(); if (node == null || cca3.isEmpty()) { uimaMonitor.warn("Empty country code found - entry will be skipped"); continue; } for (String name : getNames(node.path("name"))) { countryNames.put(name, cca3); } } uimaMonitor.info("{} country names read", countryNames.size()); return countryNames; }
String cca3 = getProperty(node.path(PROPERTIES), "ISO_A3").toUpperCase(); String geojson = getProperty(node, "geometry"); uimaMonitor.warn( "Generic country code -99 found - entry {} will not have GeoJSON information", getProperty(node.path(PROPERTIES), "ADMIN")); } else { geoJson.put(cca3, geojson);
String cca3 = getProperty(node.path(PROPERTIES), "ISO_A3").toUpperCase(); String geojson = getProperty(node, "geometry"); uimaMonitor.warn( "Generic country code -99 found - entry {} will not have GeoJSON information", getProperty(node.path(PROPERTIES), "ADMIN")); } else { geoJson.put(cca3, geojson);