Changeset 33887 for other-projects/maori-lang-detection/src/org/greenstone/atea/WebPageURLsListing.java
- Timestamp:
- 2020-01-31T23:49:11+13:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/maori-lang-detection/src/org/greenstone/atea/WebPageURLsListing.java
r33885 r33887 55 55 } 56 56 57 private String getFilePath(File file) {58 try {59 return file.getCanonicalPath();60 } catch(IOException e) {61 return file.getAbsolutePath();62 }63 }64 57 65 58 public void produceURLsForPagesInMRI(File domainsFile) { … … 69 62 70 63 System.out.println("Wrote all isMRI web page URLs for the sites in input domainsFile\ninto file: " 71 + getFilePath(outFile));64 + Utility.getFilePath(outFile)); 72 65 } 73 66 … … 78 71 79 72 System.out.println("Wrote all containsMRI web page URLs for the sites in input domainsFile\ninto file: " 80 + getFilePath(outFile));73 + Utility.getFilePath(outFile)); 81 74 } 82 75 … … 120 113 System.err.println(""); 121 114 } 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)); 123 116 logger.error(e.getMessage(), e); 124 117 } … … 159 152 writeURLsToFile(urlsList, outFile, N_totalNumPages); 160 153 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)); 162 155 163 156 // 3. calculate sample size n for population size N if using 90% confidence and 5% margin of error … … 175 168 writeURLsToFile(urlsList, outFile, n_numSampleURLs); 176 169 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)); 178 171 } 179 172 … … 219 212 } 220 213 } catch(Exception e) { 221 logger.error("Unable to write to file " + getFilePath(outFile));214 logger.error("Unable to write to file " + Utility.getFilePath(outFile)); 222 215 logger.error(e.getMessage(), e); 223 216 } … … 237 230 File outFile = new File(outFolder, "5a_counts_tentativeNonAutotranslatedSites.json"); 238 231 239 String filename = getFilePath(outFile);232 String filename = Utility.getFilePath(outFile); 240 233 241 234 try ( … … 268 261 File outFile = new File(outFolder, "5b_counts_overseasSitesWithMiInPath.json"); 269 262 270 String filename = getFilePath(outFile);263 String filename = Utility.getFilePath(outFile); 271 264 try ( 272 265 Writer writer = new BufferedWriter(new FileWriter(outFile));
Note:
See TracChangeset
for help on using the changeset viewer.