|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.filter.PredictionRewriter
public class PredictionRewriter
A prediction rewriter uses predictions from another process (e.g. named entities) and stores them as XML elements to provide additional semantic information.
Generally, you should NOT use this class -- use
PredictionRewriter2
instead.
Instances of this class are not thread-safe and must not be used to
process multiple documents in parallel.
Field Summary | |
---|---|
static String |
CONFIG_PRED_EXT
Configuration key: extension of prediction files. |
Constructor Summary | |
---|---|
PredictionRewriter(String fileExtension,
TokenizerFactory factory,
TiesConfiguration conf)
Creates a new instance. |
|
PredictionRewriter(TiesConfiguration conf)
Creates a new instance. |
Method Summary | |
---|---|
void |
processToken(Element element,
String left,
TokenDetails details,
String right,
ContextMap context)
Processes a token in an XML element, optionally modifying the element or the document it is part of. |
Document |
rewrite(Document document,
File filename)
Rewrites a document. |
String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String CONFIG_PRED_EXT
Constructor Detail |
---|
public PredictionRewriter(TiesConfiguration conf) throws ProcessingException
conf
- used to configure this instance; must not be
null
ProcessingException
- if an error occurs while initializing the
combination strategiespublic PredictionRewriter(String fileExtension, TokenizerFactory factory, TiesConfiguration conf) throws ProcessingException
fileExtension
- extension of the files containing predictionsfactory
- used to instantiate tokenizersconf
- used to configure this instance; must not be
null
ProcessingException
- if an error occurs while initializing the
combination strategiesMethod Detail |
---|
public void processToken(Element element, String left, TokenDetails details, String right, ContextMap context) throws IOException
processToken
in interface TokenProcessor
element
- the element containing the tokenleft
- the textual contents of the element to the left of the
token
(in case of mixed contents, only up to the last
preceding child element, if any)details
- details about the token to processright
- the textual contents of the element to the right of the
token
(in case of mixed contents, only up to the next
following child element, if any)context
- a map of objects that are made available for processing
IOException
- if an I/O error occurspublic Document rewrite(Document document, File filename) throws IOException, ProcessingException
rewrite
in interface DocumentRewriter
document
- the document to modifyfilename
- the name of the document
document
passed it
IOException
- if an I/O error occurs
ProcessingException
- if an error occurs during rewritingpublic String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |