up
Class GrammarExtractor

java.lang.Object
  extended by up.DefaultTreeHandler
      extended by up.GrammarExtractor
All Implemented Interfaces:
TreeHandler

public class GrammarExtractor
extends DefaultTreeHandler

Extract a PCFG from a stream of trees.


Constructor Summary
GrammarExtractor()
          Constructs a new handler.
 
Method Summary
 void exit()
          Notifies the successor of this handler about the end of the stream.
 Grammar getGrammar()
          Returns the extracted grammar.
 void init()
          Notifies the successor of this handler about the start of the stream.
 void next(Tree tree)
          Notifies the successor of this handler about the specified tree.
 
Methods inherited from class up.DefaultTreeHandler
getSuccessor, setSuccessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrammarExtractor

public GrammarExtractor()
Constructs a new handler.

Method Detail

getGrammar

public Grammar getGrammar()
Returns the extracted grammar.

Returns:
the grammar extracted by this handler

init

public void init()
Description copied from class: DefaultTreeHandler
Notifies the successor of this handler about the start of the stream.

Specified by:
init in interface TreeHandler
Overrides:
init in class DefaultTreeHandler

next

public void next(Tree tree)
Description copied from class: DefaultTreeHandler
Notifies the successor of this handler about the specified tree.

Specified by:
next in interface TreeHandler
Overrides:
next in class DefaultTreeHandler
Parameters:
tree - the tree about which the successor of this handler is to be notified

exit

public void exit()
Description copied from class: DefaultTreeHandler
Notifies the successor of this handler about the end of the stream.

Specified by:
exit in interface TreeHandler
Overrides:
exit in class DefaultTreeHandler