org.carrot2.dcs.http.xmlrpc
Class Carrot2XmlRpcHandler

java.lang.Object
  extended by org.carrot2.dcs.http.xmlrpc.Carrot2XmlRpcHandler

public class Carrot2XmlRpcHandler
extends Object

A simple XML-RPC handler for clustering requests.

Author:
Dawid Weiss

Constructor Summary
Carrot2XmlRpcHandler(AppConfig config)
          Creates a new XML-RPC handler with the given configuration.
 
Method Summary
 Vector doCluster(String query, Hashtable processingOptions, Hashtable processParameters, Vector documents)
           Clusters documents in documents array and returns an array of clusters to the caller.
 String doEcho(String in)
          Echo method to test if XML-RPC is operational.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Carrot2XmlRpcHandler

public Carrot2XmlRpcHandler(AppConfig config)
Creates a new XML-RPC handler with the given configuration.

Method Detail

doCluster

public Vector doCluster(String query,
                        Hashtable processingOptions,
                        Hashtable processParameters,
                        Vector documents)

Clusters documents in documents array and returns an array of clusters to the caller.

The input format is a sequence (vector) of tuples describing documents. Here is an example:

 String id           // Document #1
 String url
 String title
 String snippet
 String id           // Document #1
 String url
 String title
 String snippet
 ...
 String id           // Document #n
 String url
 String title
 String snippet
 
Note that if an element is empty, null should be passed (all elements must be present).

The output format is a sequence (vector) of maps, each describing a single group. Here is an example:

 String label
 vector<String> documents
 vector<Map> subclusters
 
Where subclusters are defined recursively in an identical way.

Parameters:
query - The query.
processingOptions - Configuration options. See ProcessingOptionNames for possible keys.
processParameters - Parameters passed to the clustering process.
documents - Input vector of documents.

doEcho

public final String doEcho(String in)
Echo method to test if XML-RPC is operational.

Parameters:
in - Any string.
Returns:
Returns an identical string.


Copyright (c) Dawid Weiss, Stanislaw Osinski