es.nlp.uned.weps.evaluation
Class Clustering

java.lang.Object
  extended by es.nlp.uned.weps.evaluation.Clustering

public class Clustering
extends java.lang.Object

The Class Clustering: holds the description of a clustering solution (partition of elements in different clusters). Note that we allow elements to appear in more than one cluster and that some element might not be assigned to any cluster.


Constructor Summary
Clustering(java.util.ArrayList<java.util.HashSet<java.lang.String>> partition)
          Constructor using a partition of documents.
Clustering(java.lang.String clustering_path)
          Constructor using a WePS 2007 clustering file as input.
 
Method Summary
 java.util.HashSet<java.lang.String> getAssigned()
          Gets the set of documents that have been assigned to at least one cluster.
 java.util.ArrayList<java.util.HashSet<java.lang.String>> getClusters(java.lang.String docID)
          Returns a set of clusters containing the document identifier.
 java.util.HashSet<java.lang.String> getDiscarded()
          Gets the set of discarded documents.
 java.util.HashMap<java.lang.String,java.util.HashSet<java.lang.String>> getDocumentToClustDict()
          Gets the dictionary "document identifier to clusters"
 java.util.HashMap<java.lang.String,java.util.HashSet<java.lang.String>> getIdToClustDict()
          Gets the cluster ident. to documents dictionary.
 java.util.ArrayList<java.util.HashSet<java.lang.String>> getPartition()
          Gets the documents partition.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Clustering

public Clustering(java.util.ArrayList<java.util.HashSet<java.lang.String>> partition)
Constructor using a partition of documents.

Parameters:
partition - the partition of documents.

Clustering

public Clustering(java.lang.String clustering_path)
Constructor using a WePS 2007 clustering file as input.

Parameters:
clustering_path - the path to a clustering xml in the WePS 2007 format .
Method Detail

getClusters

public java.util.ArrayList<java.util.HashSet<java.lang.String>> getClusters(java.lang.String docID)
Returns a set of clusters containing the document identifier.

Parameters:
docID - the document identifier
Returns:
the clusters

getDocumentToClustDict

public java.util.HashMap<java.lang.String,java.util.HashSet<java.lang.String>> getDocumentToClustDict()
Gets the dictionary "document identifier to clusters"

Returns:
a dictionary of {element_id => [cluster_id_1, cluster_id_3,], ...}

getIdToClustDict

public java.util.HashMap<java.lang.String,java.util.HashSet<java.lang.String>> getIdToClustDict()
Gets the cluster ident. to documents dictionary.

Returns:
a dictionary of {cluster_id => set of documents in that cluster, ...}

getPartition

public java.util.ArrayList<java.util.HashSet<java.lang.String>> getPartition()
Gets the documents partition.

Returns:
the partition

getDiscarded

public java.util.HashSet<java.lang.String> getDiscarded()
Gets the set of discarded documents.

Returns:
the discarded

getAssigned

public java.util.HashSet<java.lang.String> getAssigned()
Gets the set of documents that have been assigned to at least one cluster.

Returns:
the assigned