Ignore:
Timestamp:
2020-01-31T23:49:11+13:00 (4 years ago)
Author:
ak19
Message:
  1. Added support for writing out tables in csv format too. 2. Second table written out now. 3. Moved getFilePath() into Utility.
File:
1 edited

Legend:

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

    r33885 r33887  
    5555    }
    5656
    57     private String getFilePath(File file) {
    58     try {
    59         return file.getCanonicalPath();
    60     } catch(IOException e) {
    61         return file.getAbsolutePath();
    62     }
    63     }
    6457   
    6558    public void produceURLsForPagesInMRI(File domainsFile) {
     
    6962   
    7063    System.out.println("Wrote all isMRI web page URLs for the sites in input domainsFile\ninto file: "
    71                + getFilePath(outFile));
     64               + Utility.getFilePath(outFile));
    7265    }
    7366   
     
    7871
    7972    System.out.println("Wrote all containsMRI web page URLs for the sites in input domainsFile\ninto file: "
    80                + getFilePath(outFile));
     73               + Utility.getFilePath(outFile));
    8174    }
    8275   
     
    120113        System.err.println("");
    121114    } catch(Exception e) {
    122         logger.error("Unable to read URLs from file " + getFilePath(domainsFile));
     115        logger.error("Unable to read URLs from file " + Utility.getFilePath(domainsFile));
    123116        logger.error(e.getMessage(), e);
    124117    }
     
    159152    writeURLsToFile(urlsList, outFile, N_totalNumPages);
    160153    System.out.println("Wrote out full listing of web page URLs for sites in input domainsFile"
    161                + "\ninto file: " + getFilePath(outFile));
     154               + "\ninto file: " + Utility.getFilePath(outFile));
    162155       
    163156    // 3. calculate sample size n for population size N if using 90% confidence and 5% margin of error
     
    175168    writeURLsToFile(urlsList, outFile, n_numSampleURLs);
    176169    System.out.println("Wrote a sample of n=" + n_numSampleURLs + " of web page URLs "
    177                + "for the sites in input domainsFile\ninto file: " + getFilePath(outFile));
     170               + "for the sites in input domainsFile\ninto file: " + Utility.getFilePath(outFile));
    178171    }
    179172
     
    219212        }
    220213    } catch(Exception e) {
    221         logger.error("Unable to write to file " + getFilePath(outFile));
     214        logger.error("Unable to write to file " + Utility.getFilePath(outFile));
    222215        logger.error(e.getMessage(), e);
    223216    }
     
    237230    File outFile = new File(outFolder, "5a_counts_tentativeNonAutotranslatedSites.json");
    238231
    239     String filename = getFilePath(outFile);
     232    String filename = Utility.getFilePath(outFile);
    240233   
    241234    try (
     
    268261    File outFile = new File(outFolder, "5b_counts_overseasSitesWithMiInPath.json");
    269262
    270     String filename = getFilePath(outFile);
     263    String filename = Utility.getFilePath(outFile);
    271264    try (
    272265         Writer writer = new BufferedWriter(new FileWriter(outFile));
Note: See TracChangeset for help on using the changeset viewer.