Representation of a cluster (group) of Documents.

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

Syntax

C#
public sealed class Cluster

Remarks

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.

Examples

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.
CopyC#
// 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

System..::..Object
  Org.Carrot2.Core..::..Cluster

See Also