Changeset 33911


Ignore:
Timestamp:
02/12/20 19:12:42 (10 months ago)
Author:
ak19
Message:

Correct commit message for previous and current commit: 1. After refactoring MongoDBAccess class into additional subclass MongoDBQueryer, I split the import statements accordingly too. 2. Renamed WebPageURLsListing.java class to SummaryTool.java

Location:
other-projects/maori-lang-detection/src/org/greenstone/atea
Files:
1 edited
1 moved

Legend:

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

    r33910 r33911  
    1010import com.mongodb.MongoClientOptions;
    1111
    12 import com.mongodb.Block;
    13 
    14 import org.bson.BsonArray;
    15 import org.bson.BsonString;
    16 import org.bson.BsonValue;
    1712import org.bson.Document;
    18 import org.bson.conversions.Bson;
    19 import org.bson.json.JsonMode;
    20 import org.bson.json.JsonWriterSettings;
    21    
    22 import com.mongodb.util.JSON;
    23 //import com.mongodb.DBObject;
    24 
    25 
    26 import com.google.gson.*; // for pretty printing
    27 
    28 import java.io.BufferedReader;
    29 import java.io.BufferedWriter;
    30 import java.io.File;
    31 import java.io.FileReader;
    32 import java.io.FileWriter;
    33 import java.io.IOException;
    34 import java.io.UncheckedIOException;
    35 import java.io.Writer;
    36 
    37 import java.util.Arrays;
    38 import java.util.ArrayList;
    39 import java.util.List;
     13
    4014import java.util.Properties;
    41 import java.util.TreeSet;
    42 import java.util.regex.Pattern;
    4315
    4416import org.apache.log4j.Logger;
     
    4719import dev.morphia.*;
    4820
    49 import org.apache.commons.csv.*;
    5021
    5122/**
  • other-projects/maori-lang-detection/src/org/greenstone/atea/SummaryTool.java

    r33909 r33911  
    1616 * TO COMPILE:
    1717 *    maori-lang-detection/src$
    18  *       javac -cp ".:../conf:../lib/*" org/greenstone/atea/WebPageURLsListing.java
     18 *       javac -cp ".:../conf:../lib/*" org/greenstone/atea/SummaryTool.java
    1919 *
    2020 * TO RUN:
    2121 *    maori-lang-detection/src$
    22  *       java -cp ".:../conf:../lib/*" org/greenstone/atea/WebPageURLsListing
     22 *       java -cp ".:../conf:../lib/*" org/greenstone/atea/SummaryTool
    2323 * OR:
    24  *       java -cp ".:../conf:../lib/*" org/greenstone/atea/WebPageURLsListing ../mongodb-data/domainsNZ_IsMRI.txt
     24 *       java -cp ".:../conf:../lib/*" org/greenstone/atea/SummaryTool ../mongodb-data/domainsNZ_IsMRI.txt
    2525 *
    2626*/
    27 public class WebPageURLsListing {
    28     static Logger logger = Logger.getLogger(org.greenstone.atea.WebPageURLsListing.class.getName());
     27public class SummaryTool {
     28    static Logger logger = Logger.getLogger(org.greenstone.atea.SummaryTool.class.getName());
    2929    static private final long FIXED_SEED = 1000;
    3030   
     
    4949   
    5050   
    51     public WebPageURLsListing(MongoDBQueryer mongodbQueryer, File outFolder)
     51    public SummaryTool(MongoDBQueryer mongodbQueryer, File outFolder)
    5252    {
    5353    this.mongodbQueryer = mongodbQueryer;
     
    312312   
    313313    public static void printUsage() {
    314     System.err.println("Usage: WebPageURLsListing [domains.txt]");
     314    System.err.println("Usage: SummaryTool [domains.txt]");
    315315    }
    316316
     
    340340        // output files will be stored in mongodb-data-auto
    341341        File outFolder = new File("../mongodb-data-auto/").getAbsoluteFile();
    342         WebPageURLsListing listing = new WebPageURLsListing(mongodb, outFolder);
     342        SummaryTool listing = new SummaryTool(mongodb, outFolder);
    343343
    344344        System.out.println("*************************************");
    345345       
    346346       
    347         if(args.length >= 1) {
     347        if(args.length >= 1) { // web page urls listing mode
    348348        File domainsFile = new File(args[0]);
    349349        if(!domainsFile.exists()) {
Note: See TracChangeset for help on using the changeset viewer.