de.fu_berlin.ties.eval
Class ReEvaluator

java.lang.Object
  extended byde.fu_berlin.ties.ConfigurableProcessor
      extended byde.fu_berlin.ties.TextProcessor
          extended byde.fu_berlin.ties.eval.ReEvaluator
All Implemented Interfaces:
Processor

public class ReEvaluator
extends TextProcessor

A processor that can be used to re-evaluate the contents of an EvaluatedExtractionContainer. This can be used to switch the match mode.

Version:
$Revision: 1.6 $, $Date: 2004/04/13 07:08:27 $, $Author: siefkes $
Author:
Christian Siefkes

Field Summary
 
Fields inherited from class de.fu_berlin.ties.TextProcessor
CONFIG_POST, KEY_DIRECTORY, KEY_LOCAL_NAME, KEY_OUT_DIRECTORY, KEY_URL
 
Constructor Summary
ReEvaluator(String outExt)
          Creates a new instance, using the standard configuration.
ReEvaluator(String outExt, TiesConfiguration conf)
          Creates a new instance.
 
Method Summary
protected  EvaluatedExtractionContainer createdEvalContainer()
          Created an empty container for evaluating extractions, using the stored configuration to initialize target structure and match mode.
protected  void doProcess(Reader reader, Writer writer, ContextMap context)
          Processes the contents of a reader, writing a modified version to a writer.
 void reEvalulate(ExtractionContainer orgExtractions, EvaluatedExtractionContainer newEvaluated)
          Re-evaluates the contents of an extraction container.
 EvaluatedExtractionContainer reEvalulate(Reader reader)
          Re-evaluates the serialized contents of an extraction container, delegating to reEvalulate(ExtractionContainer, EvaluatedExtractionContainer).
 
Methods inherited from class de.fu_berlin.ties.TextProcessor
getOutFileExt, process, process, process, process, toString
 
Methods inherited from class de.fu_berlin.ties.ConfigurableProcessor
getConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReEvaluator

public ReEvaluator(String outExt)
Creates a new instance, using the standard configuration.

Parameters:
outExt - the extension to use for output files

ReEvaluator

public ReEvaluator(String outExt,
                   TiesConfiguration conf)
Creates a new instance.

Parameters:
outExt - the extension to use for output files
conf - the configuration to use
Method Detail

createdEvalContainer

protected EvaluatedExtractionContainer createdEvalContainer()
Created an empty container for evaluating extractions, using the stored configuration to initialize target structure and match mode. Subclasses can overwrite this method if the configured values are inadequate.

Returns:
the created empty container

reEvalulate

public void reEvalulate(ExtractionContainer orgExtractions,
                        EvaluatedExtractionContainer newEvaluated)
Re-evaluates the contents of an extraction container.

Parameters:
orgExtractions - the extractions to re-evaluate
newEvaluated - the re-evaluated extractions are added to this conainer

reEvalulate

public EvaluatedExtractionContainer reEvalulate(Reader reader)
                                         throws IOException
Re-evaluates the serialized contents of an extraction container, delegating to reEvalulate(ExtractionContainer, EvaluatedExtractionContainer).

Parameters:
reader - reader containg the extractions to re-evaluate in DelimSepValues format; not closed by this method
Returns:
the re-evaluated extractions
Throws:
IOException - if an I/O error occurs while reading the extractions

doProcess

protected void doProcess(Reader reader,
                         Writer writer,
                         ContextMap context)
                  throws IOException,
                         ProcessingException
Processes the contents of a reader, writing a modified version to a writer.

Specified by:
doProcess in class TextProcessor
Parameters:
reader - reader containing the text to process; should not be closed by this method
writer - the writer to write the processed text to; might be flushed but not closed by this method; if this method does not use the writer, the underlying file will be deleted afterwards
context - a map of objects that are made available for processing; when called from the implemented process methods in this class, it will contain mappings from IOUtils.KEY_LOCAL_CHARSET to the character set of the output writer; from ContentType.KEY_MIME_TYPE to the document's MIME type; from TextProcessor.KEY_LOCAL_NAME to the local name (String) and either from TextProcessor.KEY_DIRECTORY to the directory (File), in case of a local file) or from TextProcessor.KEY_URL to the URL (otherwise) of the processed document
Throws:
ProcessingException - if an error occurs during processing
IOException - if an I/O error occurs


Copyright © 2003-2004 Christian Siefkes. All Rights Reserved.