public class BracketReader extends java.lang.Object implements SyntaxGraphReader
| Constructor and Description |
|---|
BracketReader() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the file or the input stream.
|
java.lang.String |
getCharsetName() |
DataFormatInstance |
getDataFormatInstance()
Returns the input data format instance
|
java.lang.String |
getFileName() |
int |
getIterationCounter() |
int |
getNIterations() |
java.lang.String |
getOptions()
Returns a string representation of the reader specific options.
|
java.io.BufferedReader |
getReader() |
int |
getSentenceCount()
Returns the current number of the sentence.
|
java.net.URL |
getUrl() |
void |
open(java.io.InputStream is,
java.lang.String charsetName)
Opens an input stream
|
void |
open(java.lang.String fileName,
java.lang.String charsetName)
Opens a file for read only
|
void |
open(java.net.URL url,
java.lang.String charsetName)
Opens an URL for read only
|
void |
readEpilog()
Reads the end of the file, after all sentences have been processed,
|
void |
readProlog()
Cause the syntax graph reader to read the beginning of the file (such as header information)
|
boolean |
readSentence(TokenStructure syntaxGraph)
Reads a sentence (token structure, dependency structure or/and phrase structure)
|
void |
setCharsetName(java.lang.String charsetName) |
void |
setDataFormatInstance(DataFormatInstance inputDataFormatInstance)
Sets the input data format instance
|
void |
setFileName(java.lang.String fileName) |
void |
setNIterations(int iterations) |
void |
setOptions(java.lang.String optionString)
Sets the reader specific options.
|
void |
setReader(java.io.BufferedReader reader) |
void |
setSentenceCount(int sentenceCount) |
void |
setUrl(java.net.URL url) |
public BracketReader()
public void open(java.lang.String fileName, java.lang.String charsetName) throws MaltChainedException
SyntaxGraphReaderopen in interface SyntaxGraphReaderfileName - the file name of the filecharsetName - the name of the character encoding setMaltChainedExceptionpublic void open(java.net.URL url, java.lang.String charsetName) throws MaltChainedException
SyntaxGraphReaderopen in interface SyntaxGraphReaderurl - the URL of the resourcecharsetName - the name of the character encoding setMaltChainedExceptionpublic void open(java.io.InputStream is, java.lang.String charsetName) throws MaltChainedException
SyntaxGraphReaderopen in interface SyntaxGraphReaderis - an input streamcharsetName - the name of the character encoding setMaltChainedExceptionpublic void readProlog() throws MaltChainedException
SyntaxGraphReaderreadProlog in interface SyntaxGraphReaderMaltChainedExceptionpublic boolean readSentence(TokenStructure syntaxGraph) throws MaltChainedException
SyntaxGraphReaderreadSentence in interface SyntaxGraphReadersyntaxGraph - a syntax graph (token structure, dependency structure or/and phrase structure)MaltChainedExceptionpublic void readEpilog() throws MaltChainedException
SyntaxGraphReaderreadEpilog in interface SyntaxGraphReaderMaltChainedExceptionpublic java.io.BufferedReader getReader()
public void setReader(java.io.BufferedReader reader)
public int getSentenceCount() throws MaltChainedException
SyntaxGraphReadergetSentenceCount in interface SyntaxGraphReaderMaltChainedExceptionpublic void setSentenceCount(int sentenceCount)
public DataFormatInstance getDataFormatInstance()
SyntaxGraphReadergetDataFormatInstance in interface SyntaxGraphReaderpublic void setDataFormatInstance(DataFormatInstance inputDataFormatInstance)
SyntaxGraphReadersetDataFormatInstance in interface SyntaxGraphReaderinputDataFormatInstance - an input data format instancepublic java.lang.String getOptions()
SyntaxGraphReadergetOptions in interface SyntaxGraphReaderpublic void setOptions(java.lang.String optionString) throws MaltChainedException
SyntaxGraphReadersetOptions in interface SyntaxGraphReaderoptionString - a string representation of the reader specific optionsMaltChainedExceptionpublic java.lang.String getFileName()
public void setFileName(java.lang.String fileName)
public java.net.URL getUrl()
public void setUrl(java.net.URL url)
public java.lang.String getCharsetName()
public void setCharsetName(java.lang.String charsetName)
public int getNIterations()
getNIterations in interface SyntaxGraphReaderpublic void setNIterations(int iterations)
setNIterations in interface SyntaxGraphReaderpublic int getIterationCounter()
getIterationCounter in interface SyntaxGraphReaderpublic void close() throws MaltChainedException
SyntaxGraphReaderclose in interface SyntaxGraphReaderMaltChainedExceptionCopyright 2007-2017 Johan Hall, Jens Nilsson and Joakim Nivre.