com.sun.labs.minion.classification
Class KnowledgeSourceClusterer

java.lang.Object
  extended by com.sun.labs.minion.classification.ContingencyFeatureClusterer
      extended by com.sun.labs.minion.classification.KnowledgeSourceClusterer
All Implemented Interfaces:
FeatureClusterer

public class KnowledgeSourceClusterer
extends ContingencyFeatureClusterer

Provides an implementation of a feature clusterer built around a knowledge source. Variants of the same word will be grouped together into clusters. (Adapted from LiteMorphClusterer.)


Field Summary
protected  java.util.Map<java.lang.String,FeatureCluster> clusterMap
          A map to hold the clusters keyed on roots
 
Fields inherited from class com.sun.labs.minion.classification.ContingencyFeatureClusterer
clusters, field, logTag, type
 
Constructor Summary
KnowledgeSourceClusterer()
          Default constructor
KnowledgeSourceClusterer(int type)
          Create a new instance of me
 
Method Summary
protected  void addFeature(ContingencyFeature feat)
          Adds a feature to this feature clusterer.
 FeatureClusterSet cluster(ResultSetImpl s)
          Creates a set of clusters based on all of the terms in the documents contained in the ResultSet.
protected  FeatureClusterSet getClusters()
          Returns a set of feature clusters.
 FeatureClusterer newInstance()
          A non-static factory method to create a feature clusterer
 
Methods inherited from class com.sun.labs.minion.classification.ContingencyFeatureClusterer
collectFeatures, newCluster, newFeature, setDocCache, setField
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clusterMap

protected java.util.Map<java.lang.String,FeatureCluster> clusterMap
A map to hold the clusters keyed on roots

Constructor Detail

KnowledgeSourceClusterer

public KnowledgeSourceClusterer(int type)
Create a new instance of me

Parameters:
type -

KnowledgeSourceClusterer

public KnowledgeSourceClusterer()
Default constructor

Method Detail

cluster

public FeatureClusterSet cluster(ResultSetImpl s)
Description copied from class: ContingencyFeatureClusterer
Creates a set of clusters based on all of the terms in the documents contained in the ResultSet.

Specified by:
cluster in interface FeatureClusterer
Overrides:
cluster in class ContingencyFeatureClusterer
Parameters:
s - the set of documents from which features are gathered
Returns:
a set of clusters (Features) of features

newInstance

public FeatureClusterer newInstance()
Description copied from interface: FeatureClusterer
A non-static factory method to create a feature clusterer

Specified by:
newInstance in interface FeatureClusterer
Overrides:
newInstance in class ContingencyFeatureClusterer
Returns:
a feature clusterer instance

getClusters

protected FeatureClusterSet getClusters()
Description copied from class: ContingencyFeatureClusterer
Returns a set of feature clusters. Feature Clusters in this case will be ContingencyFeatures that represent clusters rather than single features. If you're writing your own clusterer, override this method.

Overrides:
getClusters in class ContingencyFeatureClusterer
Returns:
a set of clusters

addFeature

protected void addFeature(ContingencyFeature feat)
Description copied from class: ContingencyFeatureClusterer
Adds a feature to this feature clusterer. This may create a new cluster for the feature, or may add the feature to an existing cluster. If you're writing your own clusterer, override this method.

Overrides:
addFeature in class ContingencyFeatureClusterer
Parameters:
feat - the feature to add