Ignore:
Timestamp:
2020-01-24T20:48:17+13:00 (4 years ago)
Author:
ak19
Message:

Got the mongodb query working in Java in 2 different ways: the fully Java way and the way where I parse the query and parse the projection portion and then run the mongodb collection.find().projection() on it. Both work now. And thed RandomURLsForDomainGenerator now works fine.

File:
1 edited

Legend:

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

    r33869 r33870  
    6060    }
    6161
    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
    8264    File parentFolder = domainsFile.getParentFile();
    8365    String fileName = domainsFile.getName();
    8466    File outFile = new File(parentFolder, "random"+numURLs+"_"+fileName);
     67    File fullSetOutFile = new File(parentFolder, "all_"+fileName);
    8568   
    8669    // shuffle list and take the first n
Note: See TracChangeset for help on using the changeset viewer.