de.fu_berlin.ties.text
Class SimplifyQuotes
java.lang.Object
de.fu_berlin.ties.ConfigurableProcessor
de.fu_berlin.ties.TextProcessor
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
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. |
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 filesconf
- used to configure superclasses
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 methodwriter
- 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 afterwardscontext
- 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.