gov.nih.nlm.nls.nlp.taggerservices
Class XeroxParcTaggerClient

java.lang.Object
  extended by gov.nih.nlm.nls.nlp.taggerservices.XeroxParcTaggerClient
All Implemented Interfaces:
TaggerInterface

public final class XeroxParcTaggerClient
extends java.lang.Object
implements TaggerInterface

XeroxParcTaggerClient is a client to a socket based tagger server that runs locally at NLM. When this server cannot be connected to, this class throws an exception. Fri Mar 30 17:54:53 EST 2001, divita Initial Version

Version:
$Id: XeroxParcTaggerClient.java,v 1.9 2004/11/19 14:30:48 divita Exp $

Constructor Summary
XeroxParcTaggerClient()
          This is a constructor for TaggerClient This constructor has no parameters.
XeroxParcTaggerClient(gov.nih.nlm.nls.utils.GlobalBehavior pSettings)
          This is a constructor for TaggerClient
 
Method Summary
 void close()
          Method close
static int convert(java.lang.String pTag)
          Method convert converts XeroxParc part of speech tags to the part of speech tags we use.
 int correctTheTag(java.lang.String pString)
          correctTheTag checks for a string, and corrects it to what we are expecting.
protected  void finalize()
          Release any resources used for Tagger access upon object finalization.
 void init(gov.nih.nlm.nls.utils.GlobalBehavior pSettings)
          Method init
static void main(java.lang.String[] argv)
          This is a test main, whose purpose is to test the functionality of each method developed for this class.
 void processTaggerInput(Sentence pSentence, java.util.Vector pTaggerTokens)
          Method processTaggerInput adds the tagger tag to each token of the input.
 void processXeroxParcTag(Token pToken, java.lang.String pTaggerInput)
          Method processXeroxParcTag marries the tagger's tag to the token.
 void tag(Sentence pSentence)
          Method tag implements the tagInterface for the xerox parc tagger client
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XeroxParcTaggerClient

public XeroxParcTaggerClient()
                      throws java.lang.Exception
This is a constructor for TaggerClient This constructor has no parameters.

Throws:
java.lang.Exception

XeroxParcTaggerClient

public XeroxParcTaggerClient(gov.nih.nlm.nls.utils.GlobalBehavior pSettings)
                      throws java.lang.Exception
This is a constructor for TaggerClient

Parameters:
pSettings -
Throws:
java.lang.Exception
Method Detail

init

public void init(gov.nih.nlm.nls.utils.GlobalBehavior pSettings)
          throws java.lang.Exception
Method init

Parameters:
pSettings -
Throws:
java.lang.Exception

close

public void close()
Method close

Specified by:
close in interface TaggerInterface

tag

public void tag(Sentence pSentence)
Method tag implements the tagInterface for the xerox parc tagger client

Specified by:
tag in interface TaggerInterface
Parameters:
pSentence -

processTaggerInput

public void processTaggerInput(Sentence pSentence,
                               java.util.Vector pTaggerTokens)
Method processTaggerInput adds the tagger tag to each token of the input.

Parameters:
pSentence -
pTaggerTokens -

processXeroxParcTag

public void processXeroxParcTag(Token pToken,
                                java.lang.String pTaggerInput)
Method processXeroxParcTag marries the tagger's tag to the token.

Parameters:
pToken -
pTaggerInput -

convert

public static int convert(java.lang.String pTag)
Method convert converts XeroxParc part of speech tags to the part of speech tags we use.

Parameters:
pTag -
Returns:
int from Category.java

correctTheTag

public int correctTheTag(java.lang.String pString)
correctTheTag checks for a string, and corrects it to what we are expecting. There are cases where we know that the Xerox Parc tagger does a poor job of tagging. Known cases: In (initial caps) is tagged by the tagger as a noun rather than a prep. At (initial caps) is tagged by the tagger as a noun rather than a prep. run is never tagged as a verb by the tagger.

Parameters:
pString -
Returns:
pTag (Category.UNKNOWN if the tag is not to be changed )

finalize

protected void finalize()
                 throws java.lang.Throwable
Release any resources used for Tagger access upon object finalization. That is close the socket to the tagger.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

main

public static final void main(java.lang.String[] argv)
This is a test main, whose purpose is to test the functionality of each method developed for this class. This main strives to test the boundary conditions as well as some sample common ways each public method is intended to be used.

Parameters:
argv - The command line input, tokenized


The use and distribution of this material is subject to the terms and conditions included in the file SPECIALIST_NLP_TOOLS_TERMS_AND_CONDITIONS.TXT, located in the root directory of the distribution.