edu.udo.cs.wvtool.config
Class WVTConfiguration

java.lang.Object
  extended by edu.udo.cs.wvtool.config.WVTConfiguration

public class WVTConfiguration
extends java.lang.Object

WVTool Configuration. The configuration consists of a set of rules that determine which components to use for each step, dependend on given information about the document. This allows to dynamically choose, e.g. a tokenizer, depending whether the document was read from PDF or from plain text. Rules have no special structure, despite that they take document information as input and return an Object representing the component to be used. A shortcut for cases where always the same component is used, independently of the document, is the WVTConfigurationFact. Configuration rules can be provided in three ways: 1. A simple standard configuration can be used 2. The configuration can be read from a stream (not yet implemented) 3. Setter Methods can be used to create the configuration manually from Java code

Version:
$Id: WVTConfiguration.java,v 1.2 2006/06/06 11:45:24 mjwurst Exp $
Author:
Michael Wurst

Field Summary
private  java.util.Map ruleSet
          data structure to store the rules for the individual steps
static java.lang.String STEP_CHAR_MAPPER
           
static java.lang.String STEP_INPUT_FILTER
           
static java.lang.String STEP_LOADER
           
static java.lang.String STEP_OUTPUT
           
static java.lang.String STEP_STEMMER
           
static java.lang.String STEP_TOKENIZER
           
static java.lang.String STEP_VECTOR_CREATION
           
static java.lang.String STEP_WORDFILTER
           
 
Constructor Summary
WVTConfiguration()
          Creates a new instance of WVTConfiguration, setting up a standard configuration
WVTConfiguration(java.io.Reader in)
          Creates a new instance of WVTConfiguration by reading a configuration from a stream.
 
Method Summary
 java.lang.Object getComponentForStep(java.lang.String step, WVTDocumentInfo info)
          Get the object to use in a given step according to given document informations.
 void setConfigurationRule(java.lang.String step, WVTConfigurationRule rule)
          Set a rule for a given step.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STEP_INPUT_FILTER

public static final java.lang.String STEP_INPUT_FILTER
See Also:
Constant Field Values

STEP_CHAR_MAPPER

public static final java.lang.String STEP_CHAR_MAPPER
See Also:
Constant Field Values

STEP_LOADER

public static final java.lang.String STEP_LOADER
See Also:
Constant Field Values

STEP_TOKENIZER

public static final java.lang.String STEP_TOKENIZER
See Also:
Constant Field Values

STEP_WORDFILTER

public static final java.lang.String STEP_WORDFILTER
See Also:
Constant Field Values

STEP_STEMMER

public static final java.lang.String STEP_STEMMER
See Also:
Constant Field Values

STEP_VECTOR_CREATION

public static final java.lang.String STEP_VECTOR_CREATION
See Also:
Constant Field Values

STEP_OUTPUT

public static final java.lang.String STEP_OUTPUT
See Also:
Constant Field Values

ruleSet

private java.util.Map ruleSet
data structure to store the rules for the individual steps

Constructor Detail

WVTConfiguration

public WVTConfiguration(java.io.Reader in)
Creates a new instance of WVTConfiguration by reading a configuration from a stream.

Parameters:
in - the stream, from which to read the configuration


WVTConfiguration

public WVTConfiguration()
Creates a new instance of WVTConfiguration, setting up a standard configuration

Method Detail

setConfigurationRule

public final void setConfigurationRule(java.lang.String step,
                                       WVTConfigurationRule rule)
Set a rule for a given step.

Parameters:
step - the name of the step
rule - the rule for this step


getComponentForStep

public final java.lang.Object getComponentForStep(java.lang.String step,
                                                  WVTDocumentInfo info)
Get the object to use in a given step according to given document informations.

Parameters:
step - the name of the step
info - the document information
Returns:
the object to use