edu.stanford.nlp.pipeline
Class CustomAnnotationSerializer

java.lang.Object
  extended by edu.stanford.nlp.pipeline.CustomAnnotationSerializer
All Implemented Interfaces:
AnnotationSerializer

public class CustomAnnotationSerializer
extends java.lang.Object
implements AnnotationSerializer

Serializes Annotation objects using our own format.

Author:
Mihai

Constructor Summary
CustomAnnotationSerializer()
           
CustomAnnotationSerializer(boolean compress, boolean haveAnte)
           
 
Method Summary
 Annotation load(java.io.InputStream is)
          This method does its own buffering of the passed in InputStream.
static void main(java.lang.String[] args)
           
 void save(Annotation corpus, java.io.OutputStream os)
           
static void saveCorefChain(java.io.PrintWriter pw, int cid, CorefChain cluster)
          Serializes one coref cluster (i.e., one entity)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomAnnotationSerializer

public CustomAnnotationSerializer()

CustomAnnotationSerializer

public CustomAnnotationSerializer(boolean compress,
                                  boolean haveAnte)
Method Detail

load

public Annotation load(java.io.InputStream is)
                throws java.io.IOException,
                       java.lang.ClassNotFoundException,
                       java.lang.ClassCastException
This method does its own buffering of the passed in InputStream.

Specified by:
load in interface AnnotationSerializer
Throws:
java.io.IOException
java.lang.ClassNotFoundException
java.lang.ClassCastException

saveCorefChain

public static void saveCorefChain(java.io.PrintWriter pw,
                                  int cid,
                                  CorefChain cluster)
Serializes one coref cluster (i.e., one entity)

Parameters:
pw - the buffer
cid - id of cluster to save
cluster - the cluster

save

public void save(Annotation corpus,
                 java.io.OutputStream os)
          throws java.io.IOException
Specified by:
save in interface AnnotationSerializer
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception


Stanford NLP Group