|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.stanford.nlp.ie.pcfg.Parser
A "parse server" that runs Dan Klein's v2 parser. The Parser runs independently of any programs that call it. Other programs create a socket connection with the Parser to tell it that they'd like to start parsing. Then sentence/parse information is exchanged via file. In general, Dan's v2 parser takes about 10 minutes to start running. The parse server allows users to avoid this start-up cost. Parse sentence limit: 50 words. Note: you'll need to use the "java -Xmx1500m" option to get this to run. Also note: the nlp machines do not allow users to allocate java more than 1500m. Thus 50 words is an effective limit on the length of sentence that can be parsed by Dan's parser on the nlp machines (so far as I can tell). Note that a single executing parser server can only handle one client request at a time. However, the user can run separate parsers on different ports.
Field Summary | |
static String |
fn
default prefix for file used to exchange parse information. |
static int |
portNumber
default port number. |
static String |
ptb
default location for the Penn Treebank data. |
Constructor Summary | |
Parser()
|
Method Summary | |
static void |
main(String[] args)
runs the parser server. |
static Tree |
Parse(List sentence)
Asks the parser server to parse a sentence. |
static Tree |
Parse(List sentence,
int portNumber)
Asks the parser server to parse a sentence. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int portNumber
public static String fn
public static String ptb
Constructor Detail |
public Parser()
Method Detail |
public static void main(String[] args) throws Exception
args
- expects two arguments.
args[0]: port number. by default the server and client run
on port 8888.
args[1]: location of Penn Treebank. This should be something of
the form .../Treebank3/parsed/mrg/wsj. See ptb for an
example of what to use when working on ah.
Exception
public static Tree Parse(List sentence, int portNumber) throws IOException
sentence
- a list of strings (NOT XLabels!)
IOException
public static Tree Parse(List sentence) throws IOException
sentence
- a list of strings (NOT XLabels!)
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |