Jet.Parser
Class StatParser

java.lang.Object
  extended byJet.Parser.StatParser

public class StatParser
extends java.lang.Object

an interface to Dan Bikel's implementation of Collins' parser


Constructor Summary
StatParser()
           
 
Method Summary
static Annotation[] children(Annotation node)
          returns an array containing the children of 'node', or null if the node has no children.
static void clearInputAnnotations(Document doc)
          for ACE: erase all the characters within ANNOTATION ...
static java.util.Set descendants(Annotation node)
          returns a Set containing the parse tree node and all of its descendants (its children, the children of its children, etc.).
static void initialize(java.lang.String dataPath, java.util.Properties config)
          initialize the parser (load grammar and data files).
static void initialize(java.lang.String propertiesFile, java.lang.String grammarFile)
          initialize the parser.
static boolean isInitialized()
          return true if the parser has already been initialized.
static void main(java.lang.String[] args)
           
static ParseTreeNode parse(Document doc, Span span)
          parse the sentence in 'span' of Document 'doc'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatParser

public StatParser()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException

initialize

public static void initialize(java.lang.String dataPath,
                              java.util.Properties config)
initialize the parser (load grammar and data files). File names are obtainted from properties 'StatParser.properties.fileName' and 'StatParser.grammar.fileName', and are relative to 'dataPath'.


initialize

public static void initialize(java.lang.String propertiesFile,
                              java.lang.String grammarFile)
initialize the parser. Load the properties from 'propertiesFile' and the grammar from file 'grammarFile'.


isInitialized

public static boolean isInitialized()
return true if the parser has already been initialized.


parse

public static ParseTreeNode parse(Document doc,
                                  Span span)
parse the sentence in 'span' of Document 'doc'. The sentence must have been tokenized and tagged with Penn tags. The parse is returned as a nested set of ParseTreeNodes and is also added as 'constit' annotations on the Document.


children

public static Annotation[] children(Annotation node)
returns an array containing the children of 'node', or null if the node has no children.

Parameters:
node - an Annotation representing a parse tree node (an Annotation of type 'constit').

descendants

public static java.util.Set descendants(Annotation node)
returns a Set containing the parse tree node and all of its descendants (its children, the children of its children, etc.).

Parameters:
node - an Annotation representing a parse tree node (an Annotation of type 'constit').

clearInputAnnotations

public static void clearInputAnnotations(Document doc)
for ACE: erase all the characters within ANNOTATION ... /ANNOTATION