コード例 #1
0
ファイル: Cluster.java プロジェクト: ashish0038/rahasia
 /*
  * Recursive descent into subclusters.
  */
 private static void flatten(ArrayList<Cluster> flattened, Collection<Cluster> clusters) {
   for (Cluster c : clusters) {
     flattened.add(c);
     final List<Cluster> subclusters = c.getSubclusters();
     if (!subclusters.isEmpty()) {
       flatten(flattened, subclusters);
     }
   }
 }
コード例 #2
0
ファイル: Cluster.java プロジェクト: ashish0038/rahasia
 /**
  * If there are unclustered documents, appends the "Other Topics" group to the <code>clusters
  * </code>.
  *
  * @see #buildOtherTopics(List, List, String)
  */
 public static void appendOtherTopics(
     List<Document> allDocuments, List<Cluster> clusters, String label) {
   final Cluster otherTopics = buildOtherTopics(allDocuments, clusters, label);
   if (!otherTopics.getDocuments().isEmpty()) {
     clusters.add(otherTopics);
   }
 }
コード例 #3
0
ファイル: Cluster.java プロジェクト: ashish0038/rahasia
 /** For JSON serialization only. */
 @JsonProperty("clusters")
 @SuppressWarnings("unused")
 private List<Cluster> getSubclustersForSerialization() {
   return subclustersView.isEmpty() ? null : subclustersView;
 }