Package com.tamingtext.tagrecommender.TagRecommenderClient

Examples of com.tamingtext.tagrecommender.TagRecommenderClient.ScoreTagQueue


        tagCount + " tags, " + uniqueCount + " unique tags");
    System.err.println(pastCutoff + " tags occur " + cutoff + " or more times");
   
    System.err.println("Ranking tags...");
    int maxTags = pastCutoff < limit ? pastCutoff : limit;
    final ScoreTagQueue queue = new ScoreTagQueue(maxTags);
    tagCounts.forEachPair(new ObjectIntProcedure<String> () {
      @Override
      public boolean apply(String first, int second) {
        if (second >= cutoff) {
          queue.insertWithOverflow(new ScoreTag(first, second));
        }
        return true;
      }
    });
   
    ScoreTag[] rankedTags = new ScoreTag[maxTags];
    int pos = maxTags;
    while (queue.size() > 0) {
      rankedTags[--pos] = queue.pop();
    }
   
    System.err.println("Least tag count " + rankedTags[maxTags-1].getCount());
    System.err.println("Dumping Ranked Tags...");
    System.err.flush();
View Full Code Here

TOP

Related Classes of com.tamingtext.tagrecommender.TagRecommenderClient.ScoreTagQueue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.