public class Sighan2005DocumentReaderAndWriter extends Object implements DocumentReaderAndWriter<CoreLabel>, LatticeWriter<CoreLabel,String,Integer>
Note: maybe this can do less interning, since some is done in ObjectBankWrapper, but this also calls trim() as it works....
| Constructor and Description |
|---|
Sighan2005DocumentReaderAndWriter() |
| Modifier and Type | Method and Description |
|---|---|
Iterator<List<CoreLabel>> |
getIterator(Reader r)
Return an iterator over the contents read from r.
|
void |
init(SeqClassifierFlags flags)
This will be called immediately after construction.
|
void |
printAnswers(List<CoreLabel> doc,
PrintWriter pw)
This method prints the output of the classifier to a
PrintWriter. |
void |
printLattice(DFSA<String,Integer> tagLattice,
List<CoreLabel> doc,
PrintWriter out)
This method prints the output lattice (typically, Viterbi search graph) of
the classifier to a
PrintWriter. |
public Iterator<List<CoreLabel>> getIterator(Reader r)
IteratorFromReaderFactorygetIterator in interface IteratorFromReaderFactory<List<CoreLabel>>r - Where to read objects frompublic void init(SeqClassifierFlags flags)
DocumentReaderAndWriterinit in interface DocumentReaderAndWriter<CoreLabel>flags - Flags specifying behaviorpublic void printAnswers(List<CoreLabel> doc, PrintWriter pw)
DocumentReaderAndWriterPrintWriter.printAnswers in interface DocumentReaderAndWriter<CoreLabel>doc - The document which has answers (it has been classified)pw - Where to send the outputpublic void printLattice(DFSA<String,Integer> tagLattice, List<CoreLabel> doc, PrintWriter out)
LatticeWriterPrintWriter.printLattice in interface LatticeWriter<CoreLabel,String,Integer>