Changeset 33870 for other-projects/maori-lang-detection/src/org/greenstone/atea/RandomURLsForDomainGenerator.java
- Timestamp:
- 2020-01-24T20:48:17+13:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/maori-lang-detection/src/org/greenstone/atea/RandomURLsForDomainGenerator.java
r33869 r33870 60 60 } 61 61 62 // copy into array 63 /* 64 urls = new String[urlsList.size()]; 65 String[] urls = urlsList.toArray(urls); 66 urlsList.clear(); 67 */ 68 69 /* 70 // 2. generate numURLs of UNIQUE numbers between 0 to urls.length 71 // https://stackoverflow.com/questions/8115722/generating-unique-random-numbers-in-java 72 // https://www.geeksforgeeks.org/iterator-vs-foreach-in-java/ 73 // BETTER: https://stackoverflow.com/questions/5505927/how-to-generate-a-random-permutation-in-java 74 75 76 // 3. then for each number, write the url at that index in array urls into file. 77 */ 78 79 // Shuffle the urlsList, then write out the first numURLs into a file. 80 81 // BETTER: https://stackoverflow.com/questions/5505927/how-to-generate-a-random-permutation-in-java 62 // Shuffle the urlsList, then write out the first numURLs into a file. 63 // https://stackoverflow.com/questions/5505927/how-to-generate-a-random-permutation-in-java 82 64 File parentFolder = domainsFile.getParentFile(); 83 65 String fileName = domainsFile.getName(); 84 66 File outFile = new File(parentFolder, "random"+numURLs+"_"+fileName); 67 File fullSetOutFile = new File(parentFolder, "all_"+fileName); 85 68 86 69 // shuffle list and take the first n
Note:
See TracChangeset
for help on using the changeset viewer.