public class PlainTextDocumentReaderAndWriter<IN extends CoreMap> extends java.lang.Object implements DocumentReaderAndWriter<IN>
CoreMap
.
The usual case is CoreLabel
.Modifier and Type | Class and Description |
---|---|
static class |
PlainTextDocumentReaderAndWriter.OutputStyle |
Constructor and Description |
---|
PlainTextDocumentReaderAndWriter()
Construct a PlainTextDocumentReaderAndWriter.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAnswers(java.util.List<IN> l,
PlainTextDocumentReaderAndWriter.OutputStyle outputStyle,
boolean preserveSpacing) |
java.util.Iterator<java.util.List<IN>> |
getIterator(java.io.Reader r)
Return an iterator over the contents read from r.
|
void |
init(SeqClassifierFlags flags)
This will be called immediately after construction.
|
void |
init(SeqClassifierFlags flags,
TokenizerFactory<IN> tokenizerFactory) |
void |
printAnswers(java.util.List<IN> list,
java.io.PrintWriter out)
Print the classifications for the document to the given Writer.
|
void |
printAnswers(java.util.List<IN> l,
java.io.PrintWriter out,
PlainTextDocumentReaderAndWriter.OutputStyle outputStyle,
boolean preserveSpacing) |
public PlainTextDocumentReaderAndWriter()
public void init(SeqClassifierFlags flags)
DocumentReaderAndWriter
init
in interface DocumentReaderAndWriter<IN extends CoreMap>
flags
- Flags specifying behaviorpublic void init(SeqClassifierFlags flags, TokenizerFactory<IN> tokenizerFactory)
public java.util.Iterator<java.util.List<IN>> getIterator(java.io.Reader r)
IteratorFromReaderFactory
getIterator
in interface IteratorFromReaderFactory<java.util.List<IN extends CoreMap>>
r
- Where to read objects frompublic void printAnswers(java.util.List<IN> list, java.io.PrintWriter out)
outputFormat
property, and can print in
slashTags, inlineXML, xml (stand-Off XML), tsv, or a 3-column tabbed format
for easy entity retrieval. For both the XML output
formats, it preserves spacing, while for the other formats, it prints
tokenized (since preserveSpacing output is somewhat dysfunctional with these
formats, but you can control this by calling getAnswers()).printAnswers
in interface DocumentReaderAndWriter<IN extends CoreMap>
list
- List of tokens with classifier answersout
- Where to print the output topublic java.lang.String getAnswers(java.util.List<IN> l, PlainTextDocumentReaderAndWriter.OutputStyle outputStyle, boolean preserveSpacing)
public void printAnswers(java.util.List<IN> l, java.io.PrintWriter out, PlainTextDocumentReaderAndWriter.OutputStyle outputStyle, boolean preserveSpacing)