edu.stanford.nlp.pipeline
Class CustomAnnotationSerializer
java.lang.Object
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
|
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 |
CustomAnnotationSerializer
public CustomAnnotationSerializer()
CustomAnnotationSerializer
public CustomAnnotationSerializer(boolean compress,
boolean haveAnte)
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 buffercid - id of cluster to savecluster - 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