|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsem.graphreader.TSVGraphReader
public class TSVGraphReader
Class for reading graphs in the "column" format.
The section separators are on individual lines, every node and edge has a line with tab-separated values. Sentences are marked by <s>, graphs are marked by <g>, lemmas by <lem>, and edges by <gr>.
Each lemma line has the following format:
ID LEMMA POS
Each GR line has the following format:
LABEL HEAD_ID DEP_ID
Ellipes are represented by [[ellip]], null nodes by [[null]]. They can be either in the lemma list or the directly in the graph. If they are in the graph, then corresponding nodes are added to the graph. Take a look at the example files for better understanding of the format.
If a sentence has no graphs for some reason, it will return a single empty graph (with no edges). This is to facilitate retrieval by sentence and by single graphs.
Constructor Summary | |
---|---|
TSVGraphReader(java.lang.String inputPath,
boolean getAllParses)
|
Method Summary | |
---|---|
void |
close()
|
boolean |
hasNext()
Check whether there are more graphs available. |
Graph |
next()
Get the next graph from the corpus. |
java.util.ArrayList<Graph> |
nextSentence()
Read a sentence from the corpus. |
void |
reset()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TSVGraphReader(java.lang.String inputPath, boolean getAllParses) throws GraphFormatException
GraphFormatException
Method Detail |
---|
public void reset() throws GraphFormatException
reset
in interface GraphReader
GraphFormatException
public Graph next() throws GraphFormatException
next
in interface GraphReader
GraphFormatException
public boolean hasNext()
hasNext
in interface GraphReader
public void close()
close
in interface GraphReader
public java.util.ArrayList<Graph> nextSentence() throws GraphFormatException
nextSentence
in interface GraphReader
GraphFormatException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |