public interface TSVSentenceProcessor
Modifier and Type | Interface and Description |
---|---|
static class |
TSVSentenceProcessor.SentenceField
A list of possible fields in the sentence table.
|
Modifier and Type | Field and Description |
---|---|
static java.util.List<TSVSentenceProcessor.SentenceField> |
DEFAULT_SENTENCE_TABLE
The list of fields actually in the sentence table being passed as a query to TSVSentenceProcessor.
|
Modifier and Type | Method and Description |
---|---|
void |
process(long id,
Annotation doc)
Process a given sentence.
|
default void |
runAndExit(java.io.InputStream in,
java.io.PrintStream debugStream,
java.util.function.IntUnaryOperator cleanup) |
default void |
runAndExit(java.io.InputStream in,
java.io.PrintStream debugStream,
java.util.function.IntUnaryOperator cleanup,
java.util.List<TSVSentenceProcessor.SentenceField> sentenceTableSpec)
Runs the given implementation of TSVSentenceProcessor, and then exits with the appropriate error code.
|
static final java.util.List<TSVSentenceProcessor.SentenceField> DEFAULT_SENTENCE_TABLE
void process(long id, Annotation doc)
id
- The sentence id (database id) of the sentence being processed.doc
- The single-sentence document to annotate. This contains:
default void runAndExit(java.io.InputStream in, java.io.PrintStream debugStream, java.util.function.IntUnaryOperator cleanup, java.util.List<TSVSentenceProcessor.SentenceField> sentenceTableSpec)
in
- The input stream to read examples off of.debugStream
- The stream to write debugging information to (e.g., stderr).cleanup
- A function to run after annotation is over, to clean up open files, etc.
Takes as input the candidate error code, and returns a new error code to exit on.sentenceTableSpec
- The header of the sentence table fields being fed as input to this function.
By default, this can be DEFAULT_SENTENCE_TABLE
.default void runAndExit(java.io.InputStream in, java.io.PrintStream debugStream, java.util.function.IntUnaryOperator cleanup)