public class CustomAnnotationSerializer extends AnnotationSerializer
ProtobufAnnotationSerializer.AnnotationSerializer.IntermediateEdge, AnnotationSerializer.IntermediateNode, AnnotationSerializer.IntermediateSemanticGraph| Constructor and Description |
|---|
CustomAnnotationSerializer() |
CustomAnnotationSerializer(boolean compress,
boolean haveAnte) |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(java.lang.String[] args) |
Pair<Annotation,java.io.InputStream> |
read(java.io.InputStream is)
Read a single object from this stream.
|
static void |
saveCorefChain(java.io.PrintWriter pw,
int cid,
CorefChain cluster)
Serializes one coref cluster (i.e., one entity).
|
java.io.OutputStream |
write(Annotation corpus,
java.io.OutputStream os)
Append a single object to this stream.
|
readCoreDocument, writeCoreDocumentpublic CustomAnnotationSerializer()
public CustomAnnotationSerializer(boolean compress,
boolean haveAnte)
public static void saveCorefChain(java.io.PrintWriter pw,
int cid,
CorefChain cluster)
pw - the buffercid - id of cluster to savecluster - the clusterpublic java.io.OutputStream write(Annotation corpus, java.io.OutputStream os) throws java.io.IOException
AnnotationSerializerwrite in class AnnotationSerializercorpus - The document to serialize to the stream.os - The output stream to serialize to.java.io.IOException - Thrown if the underlying output stream throws the exception.public Pair<Annotation,java.io.InputStream> read(java.io.InputStream is) throws java.io.IOException
AnnotationSerializerread in class AnnotationSerializeris - The input stream to read a document from.java.io.IOException - Thrown if the underlying stream throws the exception.public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception