Class Cluster<T>

java.lang.Object
org.carrot2.clustering.Cluster<T>

public class Cluster<T> extends Object
A cluster is a named group of somehow related entities.
  • Constructor Details

    • Cluster

      public Cluster()
  • Method Details

    • getLabels

      public List<String> getLabels()
      Returns:
      Returns a list of labels describing this cluster.
    • addLabel

      public Cluster<T> addLabel(String label)
      Add a single label to this cluster.
    • getDocuments

      public List<T> getDocuments()
      Returns all documents that belong directly to this cluster.
    • addDocument

      public Cluster<T> addDocument(T document)
      Add a single document to this cluster.
    • getClusters

      public List<Cluster<T>> getClusters()
      Returns all child clusters belonging to this cluster.
    • addCluster

      public Cluster<T> addCluster(Cluster<T> cluster)
      Adds a child cluster to this cluster.
    • getScore

      public Double getScore()
      Returns this cluster's score or null, if not available.
    • setScore

      public Cluster<T> setScore(Double score)
      Sets this cluster's score.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object