com.raritantechnologies.concept.clustering
Class ResultKeywordClusterer

java.lang.Object
  extended bycom.raritantechnologies.concept.clustering.ResultKeywordClusterer
All Implemented Interfaces:
IClusterer, IConfigurable

public class ResultKeywordClusterer
extends java.lang.Object
implements IClusterer

Builds a cluster set based on the number of shared keywords between results. Uses a RelatedDocumentProcessor to build the Result interrelationships. The RelatedDocumentProcessor in turn contains an implementation of an IDocumentKeywordProcessor which can extract keywords from documents based on metadata fields, controlled vocabularies or Entity Extraction tools using the ITermExtractor interface.

This is basically an ICluster wrapper on the RelatedDocumentProcessor GatewayOutputProcessor.

XML Configuration Template:
   <Clusterer class="com.raritantechnologies.concept.clustering.ResultKeywordClusterer" >

     <RelatedDocumentProcessor resultKeyField="[ field id for document key value ]"
                                  relatedDocKeyField="[ nested result field name for related docs ]" >

       <DocumentProcessor class="[ class of com.raritantechnologies.concept.IDocumentKeywordProcessor ]" >

       </DocumentProcessor>

     </RelatedDocumentProcessor
   </Clusterer>
 

Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
ResultKeywordClusterer()
           
 
Method Summary
 void dataComplete()
          called by cluster input source when all results to be clustered have been added to the clustering engine.
 QueryResultBean getCluster(java.lang.String clusterName)
          returns the set of clustered result set keys.
 IResultSet getCluster(java.lang.String clusterName, int pageSize, int startRec)
          returns a set of clustered results for a given key.
 java.util.Set getClusterNames()
          returns the names of the clusters created.
 QueryResultBeanSet getClusterSet()
          returns the set of clusters as a QueryResultBeanSet.
 int getClusterSize(java.lang.String clusterName)
          returns the number of results for a given key.
 java.util.List getMatchingClusters(IResult result)
          Returns a list of the result keys that have this result as a related document.
 QueryResultBeanSet getSubCluster(java.lang.String clusterName)
           
 java.util.Iterator getSubClusterNames()
          if clusterer supports hierarchical clustering.
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void processResultSet(IResultSet resultSet)
          called by cluster input to add results to the clustering engine.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultKeywordClusterer

public ResultKeywordClusterer()
Method Detail

processResultSet

public void processResultSet(IResultSet resultSet)
Description copied from interface: IClusterer
called by cluster input to add results to the clustering engine.

Specified by:
processResultSet in interface IClusterer

dataComplete

public void dataComplete()
called by cluster input source when all results to be clustered have been added to the clustering engine.

Specified by:
dataComplete in interface IClusterer

getClusterNames

public java.util.Set getClusterNames()
returns the names of the clusters created.

Specified by:
getClusterNames in interface IClusterer

getClusterSize

public int getClusterSize(java.lang.String clusterName)
returns the number of results for a given key.

Specified by:
getClusterSize in interface IClusterer

getClusterSet

public QueryResultBeanSet getClusterSet()
returns the set of clusters as a QueryResultBeanSet.

Specified by:
getClusterSet in interface IClusterer

getCluster

public QueryResultBean getCluster(java.lang.String clusterName)
returns the set of clustered result set keys.

Specified by:
getCluster in interface IClusterer

getCluster

public IResultSet getCluster(java.lang.String clusterName,
                             int pageSize,
                             int startRec)
returns a set of clustered results for a given key.

Specified by:
getCluster in interface IClusterer

getSubClusterNames

public java.util.Iterator getSubClusterNames()
Description copied from interface: IClusterer
if clusterer supports hierarchical clustering. Returns names of child cluster sets.

Specified by:
getSubClusterNames in interface IClusterer

getSubCluster

public QueryResultBeanSet getSubCluster(java.lang.String clusterName)
Specified by:
getSubCluster in interface IClusterer

getMatchingClusters

public java.util.List getMatchingClusters(IResult result)
Returns a list of the result keys that have this result as a related document. I.e. return other results that are associated with this result based on shared keywords.

Specified by:
getMatchingClusters in interface IClusterer

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IConfigurable