public class LexicalizedParserServer
extends java.lang.Object
| Constructor and Description |
|---|
LexicalizedParserServer(int port,
java.lang.String model) |
LexicalizedParserServer(int port,
java.lang.String model,
LexicalizedParser parser) |
| Modifier and Type | Method and Description |
|---|---|
void |
handleParse(java.lang.String arg,
java.io.OutputStream outStream)
Returns the result of applying the parser to arg as a string.
|
void |
handleQuit()
Tells the server to exit.
|
void |
handleTree(java.lang.String arg,
java.io.OutputStream outStream)
Returns the result of applying the parser to arg as a serialized tree.
|
void |
listen()
Runs in a loop, getting requests from new clients until a client
tells us to exit.
|
static void |
main(java.lang.String[] args) |
void |
processRequest(java.net.Socket clientSocket)
Possible commands are of the form:
quit parse query: returns a String of the parsed query tree query: returns a serialized Tree of the parsed query |
public LexicalizedParserServer(int port,
java.lang.String model)
throws java.io.IOException
java.io.IOExceptionpublic LexicalizedParserServer(int port,
java.lang.String model,
LexicalizedParser parser)
throws java.io.IOException
java.io.IOExceptionpublic void listen()
throws java.io.IOException
java.io.IOExceptionpublic void processRequest(java.net.Socket clientSocket)
throws java.io.IOException
java.io.IOExceptionpublic void handleQuit()
public void handleTree(java.lang.String arg,
java.io.OutputStream outStream)
throws java.io.IOException
java.io.IOExceptionpublic void handleParse(java.lang.String arg,
java.io.OutputStream outStream)
throws java.io.IOException
java.io.IOExceptionpublic static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOException