Ignore:
Timestamp:
2019-12-12T18:04:10+13:00 (4 years ago)
Author:
ak19
Message:

Removed an adult site from crawled contents and added its url to blacklist conf file (for if ever anyone crawls our MRI set of common crawl sites again)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/maori-lang-detection/src/org/greenstone/atea/CountryCodeCountsMapData.java

    r33799 r33800  
    248248    }
    249249
    250 
    251250    // create rectangular "histogram" for each country code
    252251    private Geometry toPolygon(JsonObject json, int count, int HISTOGRAM_WIDTH) {
     
    337336         Writer writer = new BufferedWriter(new FileWriter(outFile));
    338337         ) {
    339 
    340        
    341         //multiPointGeojsonString = multiPointGeojsonString.replace("[[", "\n[\n\t[");
    342         //multiPointGeojsonString = multiPointGeojsonString.replace("],[", "],\n\t[");
    343         //multiPointGeojsonString = multiPointGeojsonString.replace("]]", "]\n]");
    344338       
    345339        writer.write(featuresGeojsonString + "\n");
     
    356350
    357351   
     352    public int getTotalCount() {
     353    int total = 0;
     354    for(JsonElement obj : this.countryCountsJsonArray) {
     355        JsonObject json = obj.getAsJsonObject();
     356        int count = json.get("count").getAsInt();
     357        total += count;     
     358    }
     359    return total;
     360    }
     361
     362   
    358363    // Unfinished and unused
    359364    public void parseCSVFile(String filename) throws Exception {
     
    381386        CountryCodeCountsMapData mapData = new CountryCodeCountsMapData(args[0], args[1]);
    382387
    383         //Geometry geometry = mapData.toMultiPointGeoJSON();
    384         //String multiPointGeojsonString = FeatureConverter.toStringValue(geometry);
    385         //System.err.println("geometry: " + multiPointGeojsonString);
    386 
    387388        String multipointOutFileName = mapData.writeMultiPointGeoJsonToFile(parentFolder);     
    388389        String featuresOutFileName = mapData.writeFeaturesGeoJsonToFile(parentFolder);
     390       
    389391        System.err.println("***********\nWrote mapdata to files " + multipointOutFileName
    390392                   + " and " + featuresOutFileName);
     
    392394                   + "editor at http://geojson.tools/ to see the data arranged on a world map");
    393395
     396        System.err.println("Total count for query: " + mapData.getTotalCount());
     397       
    394398    } catch(Exception e) {
    395399        logger.error(e.getMessage(), e);
Note: See TracChangeset for help on using the changeset viewer.