edu.stanford.nlp.parser.server
Class LexicalizedParserServer

java.lang.Object
  extended by edu.stanford.nlp.parser.server.LexicalizedParserServer

public class LexicalizedParserServer
extends java.lang.Object

Serves requests to the given parser model on the given port. See processRequest for a description of the query formats that are handled.


Constructor Summary
LexicalizedParserServer(int port, java.lang.String model)
           
LexicalizedParserServer(int port, java.lang.String model, LexicalizedParser parser)
           
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LexicalizedParserServer

public LexicalizedParserServer(int port,
                               java.lang.String model)
                        throws java.io.IOException
Throws:
java.io.IOException

LexicalizedParserServer

public LexicalizedParserServer(int port,
                               java.lang.String model,
                               LexicalizedParser parser)
                        throws java.io.IOException
Throws:
java.io.IOException
Method Detail

listen

public void listen()
            throws java.io.IOException
Runs in a loop, getting requests from new clients until a client tells us to exit.

Throws:
java.io.IOException

processRequest

public void processRequest(java.net.Socket clientSocket)
                    throws java.io.IOException
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

Throws:
java.io.IOException

handleQuit

public void handleQuit()
Tells the server to exit.


handleTree

public void handleTree(java.lang.String arg,
                       java.io.OutputStream outStream)
                throws java.io.IOException
Returns the result of applying the parser to arg as a serialized tree.

Throws:
java.io.IOException

handleParse

public void handleParse(java.lang.String arg,
                        java.io.OutputStream outStream)
                 throws java.io.IOException
Returns the result of applying the parser to arg as a string.

Throws:
java.io.IOException

main

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


Stanford NLP Group