public class StatParser extends Object
| Constructor and Description |
|---|
StatParser() |
| Modifier and Type | Method and Description |
|---|---|
static void |
buildParserInput(Document doc,
int start,
int end,
boolean setPOS)
build the arrays 'words', 'spans', 'wordDefns', and 'pennPOS' for
the parser:
words[i] = the i-th word string, for the PTB parser
(normalized to PTB form, such as -LRB- for '('
spans[i] = the span of the i-th word string
wordDefns[i] = the Jet word defn of the i-th sentence element
(if there are several defns, takes the first one)
pennPOS[i] = the PTB POS for the i-th sentence element
|
static Annotation |
buildWordDefn(Document doc,
String word,
Span span,
Annotation wordDefn,
String pennPOS) |
static void |
clearInputAnnotations(Document doc)
for ACE: erase all the characters within ANNOTATION ...
|
static void |
deleteUnusedConstits(Document doc,
Span span,
Annotation rootAnnotation)
deletes all annotations of type 'constit' within span 'span' of
Document 'doc' which are not descendants of 'rootAnnotation'.
|
static Set<Annotation> |
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 |
fixHyphenatedItems(Document doc)
for hyphenated forms X-Y, which are treated as three separate tokens
by the ACE tokenizer, create a single constituent with category 'hyphword'
and Penn POS JJ.
|
static void |
initialize(String dataPath,
Properties config)
initialize the parser (load grammar and data files).
|
static void |
initialize(String propertiesFile,
String grammarFile)
initialize the parser.
|
static boolean |
isInitialized()
return true if the parser has already been initialized.
|
static void |
main(String[] args)
Apply the Bikel parser to a collection of documents, writing out the
resulting parses as XML annotations on the documents.
|
static ParseTreeNode |
parse(Document doc,
Span span)
parse the sentence in 'span' of Document 'doc'.
|
public static void main(String[] args) throws IOException
IOExceptionpublic static void initialize(String dataPath, Properties config)
public static void initialize(String propertiesFile, String grammarFile)
public static boolean isInitialized()
public static ParseTreeNode parse(Document doc, Span span)
public static void deleteUnusedConstits(Document doc, Span span, Annotation rootAnnotation)
public static void buildParserInput(Document doc, int start, int end, boolean setPOS)
public static void fixHyphenatedItems(Document doc)
public static Annotation buildWordDefn(Document doc, String word, Span span, Annotation wordDefn, String pennPOS)
public static Set<Annotation> descendants(Annotation node)
node - an Annotation representing a parse tree node
(an Annotation of type 'constit').public static void clearInputAnnotations(Document doc)
Copyright © 2016 New York University. All rights reserved.