sem.graphreader
Class ParsevalGraphReader

java.lang.Object
  extended by sem.graphreader.ParsevalGraphReader
All Implemented Interfaces:
GraphReader

public class ParsevalGraphReader
extends java.lang.Object
implements GraphReader

Graph reader for the Parseval format. It will also work with the DepBank/GR format, but it will not correctly map lemmas together, as that representation doesn't include token numbering.

Example files were parsed using: ./rasp.sh -m -p'-e'


Constructor Summary
ParsevalGraphReader(java.lang.String inputPath, boolean simpleEdgeFormat, boolean simpleNodeFormat)
          GraphReader for the Parseval format.
 
Method Summary
 void close()
          Close the reader.
 boolean hasNext()
          Check whether there is another graph available.
static void main(java.lang.String[] args)
           
 Graph next()
          Get the next graph.
 java.util.ArrayList<Graph> nextSentence()
          Get the next sentence.
 void reset()
          Reset the reader.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParsevalGraphReader

public ParsevalGraphReader(java.lang.String inputPath,
                           boolean simpleEdgeFormat,
                           boolean simpleNodeFormat)
                    throws GraphFormatException
GraphReader for the Parseval format. The default (full) format represents nodes as lemma+suffix:id_POS or lemma+suffix:id, e.g. algorithm+s:6_NOUN or algorithm+s:6_NOUN The simple format has each node containing only the label/lemma, e.g. algorithms. We can also enable this if we want to force all the extra information to be retained in the node label.

Parameters:
inputPath -
simpleFormat - Enable simple node format
Throws:
GraphFormatException
Method Detail

hasNext

public boolean hasNext()
Check whether there is another graph available.

Specified by:
hasNext in interface GraphReader
Returns:
True if there is at least one more graph, false otherwise.

next

public Graph next()
           throws GraphFormatException
Get the next graph.

Specified by:
next in interface GraphReader
Returns:
The next graph.
Throws:
GraphFormatException

nextSentence

public java.util.ArrayList<Graph> nextSentence()
                                        throws GraphFormatException
Get the next sentence.

Specified by:
nextSentence in interface GraphReader
Returns:
The next sentence.
Throws:
GraphFormatException

reset

public void reset()
           throws GraphFormatException
Reset the reader.

Specified by:
reset in interface GraphReader
Throws:
GraphFormatException

close

public void close()
Close the reader.

Specified by:
close in interface GraphReader

main

public static void main(java.lang.String[] args)