Representation of a cluster (group) of Documents.

Namespace: Org.Carrot2.Core
Assembly: Org.Carrot2.Core.NET (in Org.Carrot2.Core.NET.dll) Version:


public sealed class Cluster


Each cluster has a human-readable Label consisting of one or more Phrases, a list of Documents it contains and a (potentially empty) list of its Subclusters.

Optionally, additional attributes can be associated with a cluster. An example of such an attribute is IsOtherTopics which indicates the cluster is composed of unrelated documents and can be hidden in the user interface. All attributes are available as a dictionary via the Attributes property.


This example shows how to display the title (label) of a cluster, the number of documents in this and subclusters and the cluster's score.
// We assume a reference to c is given.
Cluster c = ...;

Console.WriteLine("Title: " + (c.IsOtherTopics ? "Unrelated documents." : c.Label));
Console.WriteLine("Documents: " + c.AllDocuments.Count);
Console.WriteLine("Subclusters: " + c.Subclusters.Count);
Console.WriteLine("Score (via attribute indexer): " + c["score"]);
Console.WriteLine("Score (via property): " + c.Score);

Inheritance Hierarchy


See Also