public class NegraWriter extends java.lang.Object implements SyntaxGraphWriter
| Constructor and Description |
|---|
NegraWriter() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the file or the output stream.
|
DataFormatInstance |
getDataFormatInstance()
Returns the output data format instance
|
java.lang.String |
getOptions()
Returns a string representation of the writer specific options.
|
int |
getSentenceCount() |
java.io.BufferedWriter |
getWriter() |
void |
open(java.io.OutputStream os,
java.lang.String charsetName)
Opens an output stream
|
void |
open(java.lang.String fileName,
java.lang.String charsetName)
Opens a file for writing
|
void |
setDataFormatInstance(DataFormatInstance dataFormatInstance)
Sets the output data format instance
|
void |
setOptions(java.lang.String optionString)
Sets the writer specific options.
|
void |
setSentenceCount(int sentenceCount) |
void |
setWriter(java.io.BufferedWriter writer) |
void |
writeEpilog()
Writes the end of the file
|
void |
writeProlog()
Cause the syntax graph writer to write the beginning of the file (such as header information)
|
void |
writeSentence(TokenStructure syntaxGraph)
Writes a sentence (token structure, dependency structure or/and phrase structure)
|
public NegraWriter()
public void open(java.lang.String fileName, java.lang.String charsetName) throws MaltChainedException
SyntaxGraphWriteropen in interface SyntaxGraphWriterfileName - the file name of the filecharsetName - the name of the character encoding setMaltChainedExceptionpublic void open(java.io.OutputStream os, java.lang.String charsetName) throws MaltChainedException
SyntaxGraphWriteropen in interface SyntaxGraphWriteros - an output streamcharsetName - the name of the character encoding setMaltChainedExceptionpublic void writeProlog() throws MaltChainedException
SyntaxGraphWriterwriteProlog in interface SyntaxGraphWriterMaltChainedExceptionpublic void writeSentence(TokenStructure syntaxGraph) throws MaltChainedException
SyntaxGraphWriterwriteSentence in interface SyntaxGraphWritersyntaxGraph - a syntax graph (token structure, dependency structure or/and phrase structure)MaltChainedExceptionpublic void writeEpilog() throws MaltChainedException
SyntaxGraphWriterwriteEpilog in interface SyntaxGraphWriterMaltChainedExceptionpublic java.io.BufferedWriter getWriter()
public void setWriter(java.io.BufferedWriter writer)
public int getSentenceCount()
public void setSentenceCount(int sentenceCount)
public DataFormatInstance getDataFormatInstance()
SyntaxGraphWritergetDataFormatInstance in interface SyntaxGraphWriterpublic void setDataFormatInstance(DataFormatInstance dataFormatInstance)
SyntaxGraphWritersetDataFormatInstance in interface SyntaxGraphWriterdataFormatInstance - an output data format instancepublic java.lang.String getOptions()
SyntaxGraphWritergetOptions in interface SyntaxGraphWriterpublic void setOptions(java.lang.String optionString) throws MaltChainedException
SyntaxGraphWritersetOptions in interface SyntaxGraphWriteroptionString - a string representation of the writer specific optionsMaltChainedExceptionpublic void close() throws MaltChainedException
SyntaxGraphWriterclose in interface SyntaxGraphWriterMaltChainedExceptionCopyright 2007-2017 Johan Hall, Jens Nilsson and Joakim Nivre.