TC Java
2009 Version

gov.nih.nlm.nls.tc.Api
Class StWsdApi

java.lang.Object
  extended by gov.nih.nlm.nls.tc.Api.StWsdApi

public class StWsdApi
extends java.lang.Object

This class provides Word Sense Disambiguation Tool API using STI. It takes a in text, ambiguous word, choices (Sts), and score type as input.

History:

Version:
V-2009

Field Summary
protected  Configuration conf_
           
protected  java.lang.String configFile_
           
protected  JournalDescriptors jds_
           
protected  SemanticTypes sts_
           
static int TYPE_CS
           
static int TYPE_DC
           
static int TYPE_WC
           
protected  boolean verbose_
           
 
Constructor Summary
StWsdApi(Configuration conf)
          Creates an WsdApi object and initiate related data, using a specified configuration object.
StWsdApi(Configuration conf, SemanticTypes sts, JournalDescriptors jds)
          Creates an WsdApi object and initiate related data, using a specified configuration object and semantic types object.
StWsdApi(java.sql.Connection conn)
          Creates an WsdApi object and initiate related data, using a specified database connection object.
StWsdApi(java.sql.Connection conn, SemanticTypes sts, JournalDescriptors jds)
          Creates an WsdApi object and initiate related data, using a specified database connection object and semantic types object.
StWsdApi(java.util.Hashtable<java.lang.String,java.lang.String> properties)
          Creates an WsdApi object and initiate related data, using a specified properties to be overwritten in configuration.
StWsdApi(java.lang.String configFile)
          Creates an WsdApi object and initiate related data, using a specified configuration file.
 
Method Summary
 void Close()
          Close STI database connection.
 java.lang.String GetDetailStr()
          Get WSD Detail String.
 java.lang.String GetErrStr()
          Get WSD Error String.
 JournalDescriptors GetJournalDescriptors()
          Get the Journal Descriptor object.
 SemanticTypes GetSemanticTypes()
          Get the Semantic Types object.
 java.lang.String GetStAbbrForWsd(java.lang.String inSentence, java.lang.String ambiguousWord, java.util.Vector<java.lang.String> stCandidates)
          Get ST abbreviatoin for WSD.
 java.lang.String GetStAbbrForWsd(java.lang.String inSentence, java.lang.String ambiguousWord, java.util.Vector<java.lang.String> stCandidates, int methodType, boolean detailFlag, boolean useAmbiguousSentences, boolean useRealTimeMethod)
          Get ST abbreviatoin for WSD.
 java.lang.String GetStAbbrForWsd(java.lang.String inSentence, java.lang.String ambiguousWord, java.util.Vector<java.lang.String> stCandidates, int methodType, boolean detailFlag, boolean useAmbiguousSentences, boolean useRealTimeMethod, java.lang.String version)
          Get ST abbreviatoin for WSD.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_WC

public static final int TYPE_WC
See Also:
Constant Field Values

TYPE_DC

public static final int TYPE_DC
See Also:
Constant Field Values

TYPE_CS

public static final int TYPE_CS
See Also:
Constant Field Values

configFile_

protected java.lang.String configFile_

conf_

protected Configuration conf_

verbose_

protected boolean verbose_

sts_

protected SemanticTypes sts_

jds_

protected JournalDescriptors jds_
Constructor Detail

StWsdApi

public StWsdApi(Configuration conf)
Creates an WsdApi object and initiate related data, using a specified configuration object.

Close( ) method must be called to close Db connection after using a WsdApi object.

Parameters:
conf - Configuration object

StWsdApi

public StWsdApi(java.lang.String configFile)
Creates an WsdApi object and initiate related data, using a specified configuration file.

Close( ) method must be called to close Db connection after using a WsdApi object.

Parameters:
configFile - the absolute path of the configuration file

StWsdApi

public StWsdApi(java.sql.Connection conn)
Creates an WsdApi object and initiate related data, using a specified database connection object.

Close( ) method must be called to close Db connection after using a WsdApi object.

Parameters:
conn - Db connection object

StWsdApi

public StWsdApi(java.util.Hashtable<java.lang.String,java.lang.String> properties)
Creates an WsdApi object and initiate related data, using a specified properties to be overwritten in configuration.

Close( ) method must be called to close Db connection after using a WsdApi object.

Parameters:
properties - properties to be overwrite in configuration

StWsdApi

public StWsdApi(Configuration conf,
                SemanticTypes sts,
                JournalDescriptors jds)
Creates an WsdApi object and initiate related data, using a specified configuration object and semantic types object.

Close( ) method must be called to close Db connection after using a WsdApi object.

Parameters:
conf - Configuration object
sts - Semantic types objects
jds - Journal descriptor object

StWsdApi

public StWsdApi(java.sql.Connection conn,
                SemanticTypes sts,
                JournalDescriptors jds)
Creates an WsdApi object and initiate related data, using a specified database connection object and semantic types object.

Close( ) method must be called to close Db connection after using a WsdApi object.

Parameters:
conn - Database connection object
sts - Semantic types objects
Method Detail

GetStAbbrForWsd

public java.lang.String GetStAbbrForWsd(java.lang.String inSentence,
                                        java.lang.String ambiguousWord,
                                        java.util.Vector<java.lang.String> stCandidates)
Get ST abbreviatoin for WSD.

Parameters:
inSentence - input sentences (phrase, TI, AB)
ambiguousWord - the ambiguous word to be disambuguation
stCandidates - ST candidates in abbreviations for possible senses
Returns:
ST abbreviation, empty string if no ST found

GetStAbbrForWsd

public java.lang.String GetStAbbrForWsd(java.lang.String inSentence,
                                        java.lang.String ambiguousWord,
                                        java.util.Vector<java.lang.String> stCandidates,
                                        int methodType,
                                        boolean detailFlag,
                                        boolean useAmbiguousSentences,
                                        boolean useRealTimeMethod)
Get ST abbreviatoin for WSD.

Parameters:
inSentence - input sentences (phrase, TI, AB)
ambiguousWord - the ambiguous word to be disambuguation
stCandidates - ST candidates in abbreviations for possible senses
methodType - WC, DC, or CS (combined scores)
detailFlag - a flag to show detail debug infromation
useAmbiguousSentences - a flag to use ambiguous sentences only
useRealTimeMethod - a flag to use real-time method, Stri
Returns:
ST abbreviation, empty string if no ST found

GetStAbbrForWsd

public java.lang.String GetStAbbrForWsd(java.lang.String inSentence,
                                        java.lang.String ambiguousWord,
                                        java.util.Vector<java.lang.String> stCandidates,
                                        int methodType,
                                        boolean detailFlag,
                                        boolean useAmbiguousSentences,
                                        boolean useRealTimeMethod,
                                        java.lang.String version)
Get ST abbreviatoin for WSD.

Parameters:
inSentence - input sentences (phrase, TI, AB)
ambiguousWord - the ambiguous word to be disambuguation
stCandidates - ST candidates in abbreviations for possible senses
methodType - WC, DC, or CS (combined scores)
detailFlag - a flag to show detail debug infromation
useAmbiguousSentences - a flag to use ambiguous sentences only
useRealTimeMethod - a flag to use real-time method, Stri
version - the specified verion to run
Returns:
ST abbreviation, empty string if no ST found

GetSemanticTypes

public SemanticTypes GetSemanticTypes()
Get the Semantic Types object.

Returns:
Semantic Types java object

GetJournalDescriptors

public JournalDescriptors GetJournalDescriptors()
Get the Journal Descriptor object.

Returns:
Journal Descriptor java object

GetDetailStr

public java.lang.String GetDetailStr()
Get WSD Detail String.

Returns:
WSD detail information in String

GetErrStr

public java.lang.String GetErrStr()
Get WSD Error String.

Returns:
WSD error information in String

Close

public void Close()
Close STI database connection. This method must be called before exiting WsdApi.


TC Java
2009 Version

Submit a bug or feature

Copyright © 2009 National Library of Medicine