org.apache.nutch.clustering.carrot2
Class HitsClusterAdapter

java.lang.Object
  extended by org.apache.nutch.clustering.carrot2.HitsClusterAdapter
All Implemented Interfaces:
HitsCluster

public class HitsClusterAdapter
extends Object
implements HitsCluster

An adapter of Carrot2's RawCluster interface to HitsCluster interface.


Constructor Summary
HitsClusterAdapter(org.carrot2.core.clustering.RawCluster rawCluster, HitDetails[] hits)
          Creates a new adapter.
 
Method Summary
 String[] getDescriptionLabels()
           
 HitDetails[] getHits()
           
 HitsCluster[] getSubclusters()
           
 boolean isJunkCluster()
          Returns true if this cluster constains documents that did not fit anywhere else (presentation layer may discard such clusters).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HitsClusterAdapter

public HitsClusterAdapter(org.carrot2.core.clustering.RawCluster rawCluster,
                          HitDetails[] hits)
Creates a new adapter.

Method Detail

getSubclusters

public HitsCluster[] getSubclusters()
Specified by:
getSubclusters in interface HitsCluster
Returns:
Returns an array of HitsCluster objects that are sub-groups of the current group, or null if this cluster has no sub-groups.

getHits

public HitDetails[] getHits()
Specified by:
getHits in interface HitsCluster
Returns:
Returns a relevance-ordered array of the hits belonging to this cluster or null if this cluster has no associated documents (it may have subclusters only).

getDescriptionLabels

public String[] getDescriptionLabels()
Specified by:
getDescriptionLabels in interface HitsCluster
Returns:
Returns an array of labels for this cluster. The labels should be sorted according to their relevance to the cluster's content. Not all of the labels must be displayed - the application is free to set a cutoff threshold and display only the topmost labels.

isJunkCluster

public boolean isJunkCluster()
Description copied from interface: HitsCluster
Returns true if this cluster constains documents that did not fit anywhere else (presentation layer may discard such clusters).

Subclusters of this cluster are also junk clusters, even if they don't have this property set to true

Specified by:
isJunkCluster in interface HitsCluster


Copyright © 2006 The Apache Software Foundation