de.fu_berlin.ties.text
Class SimplifyQuotes

java.lang.Object
  extended by de.fu_berlin.ties.ConfigurableProcessor
      extended by de.fu_berlin.ties.TextProcessor
          extended by de.fu_berlin.ties.text.SimplifyQuotes
All Implemented Interfaces:
Processor

public class SimplifyQuotes
extends TextProcessor

Simplifies different kinds of quotes that can occur in text files, replacing all kinds of quotes by a " character.

The simplifyQuotes(String) method can be used statically, instance creation is only necessary if you want to .

Version:
$Revision: 1.5 $, $Date: 2006/10/21 16:04:25 $, $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
SimplifyQuotes(String outExt)
          Creates a new instance.
SimplifyQuotes(String outExt, TiesConfiguration conf)
          Creates a new instance.
 
Method Summary
protected  void doProcess(Reader reader, Writer writer, ContextMap context)
          Processes the contents of a reader, writing a modified version to a writer.
static String simplifyQuotes(String input)
          Simplifies different kinds of quotes that can occur in text files, replacing all kinds of quotes by a " character.
 
Methods inherited from class de.fu_berlin.ties.TextProcessor
getOutFileExt, process, process, 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

SimplifyQuotes

public SimplifyQuotes(String outExt)
Creates a new instance.

Parameters:
outExt - the extension to use for output files

SimplifyQuotes

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

Parameters:
outExt - the extension to use for output files
conf - used to configure superclasses
Method Detail

simplifyQuotes

public static String simplifyQuotes(String input)
Simplifies different kinds of quotes that can occur in text files, replacing all kinds of quotes by a " character.

Parameters:
input - the input text to simplify
Returns:
a string created by simplifying all quotes in the input

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 TextProcessor.KEY_OUT_DIRECTORY to the output directory (File); 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 input directory (File), in case of a local file) or from TextProcessor.KEY_URL to the URL (otherwise) of the processed document
Throws:
IOException - if an I/O error occurs
ProcessingException - if an error occurs during processing


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