edu.stanford.nlp.tagger.maxent
Class MaxentTaggerServer

java.lang.Object
  extended by edu.stanford.nlp.tagger.maxent.MaxentTaggerServer

public class MaxentTaggerServer
extends java.lang.Object

A POS tagger server for the Stanford POS Tagger. Runs on a socket and waits for text to tag and returns the tagged text.

Author:
Christopher Manning

Constructor Summary
MaxentTaggerServer(int port, edu.stanford.nlp.tagger.maxent.MaxentTagger.TaggerWrapper tagger, java.lang.String charset)
          Creates a new tagger server on the specified port.
 
Method Summary
static void main(java.lang.String[] args)
          Starts this server on the specified port.
 void run()
          Runs this tagger server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaxentTaggerServer

public MaxentTaggerServer(int port,
                          edu.stanford.nlp.tagger.maxent.MaxentTagger.TaggerWrapper tagger,
                          java.lang.String charset)
                   throws java.io.IOException
Creates a new tagger server on the specified port.

Parameters:
port - the port this NERServer listens on.
tagger - The classifier which will do the tagging
charset - The character set for encoding Strings over the socket stream, e.g., "utf-8"
Throws:
java.io.IOException - If there is a problem creating a ServerSocket
Method Detail

run

public void run()
Runs this tagger server.


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Starts this server on the specified port. The classifier used can be either a default one stored in the jar file from which this code is invoked or you can specify it as a filename or as another classifier resource name, which must correspond to the name of a resource in the /classifiers/ directory of the jar file.

Usage: java edu.stanford.nlp.tagger.maxent.MaxentTaggerServer [-model file|-client] -port portNumber [other MaxentTagger options]

Parameters:
args - Command-line arguments (described above)
Throws:
java.lang.Exception - If file or Java class problems with serialized classifier


Stanford NLP Group