Lvg Java
2011 Version

gov.nih.nlm.nls.lvg.Api
Class NormApi

java.lang.Object
  extended by gov.nih.nlm.nls.lvg.Api.NormApi

public class NormApi
extends java.lang.Object

This class provides an API for norm.

History:

Version:
V-2011
Author:
NLM NLS Development Team

Constructor Summary
NormApi()
          Creates a NormApi object and initiate related data (default).
NormApi(java.sql.Connection conn, RamTrie ramTrieI)
          Creates a NormApi object and initiate related data using specified database connection and persistent trie.
NormApi(java.util.Hashtable<java.lang.String,java.lang.String> properties)
          Creates a NormApi object and initiate related data with properties needs to be overwritten
NormApi(java.lang.String configFile)
          Creates a NormApi object and initiate related data using a specified configuration file.
NormApi(java.lang.String configFile, java.util.Hashtable<java.lang.String,java.lang.String> properties)
          Creates a NormApi object and initiate related data using a specified configuration file with properties to be wverwritten.
 
Method Summary
 void CleanUp()
          Close Lvg database connection and persistent tries.
 Configuration GetConfiguration()
          A method to get the configuration object
 java.sql.Connection GetConnection()
          A method to get the established database connection
 RamTrie GetTrie()
          A method to get the persistent trie for inflectional morphology
 java.util.Vector<LexItem> Mutate(LexItem in)
          A method to get the normalized strings of an input LexItem
 java.util.Vector<java.lang.String> Mutate(java.lang.String inTerm)
          A method to get the normalized strings of an input string
 java.util.Vector<LexItem> Mutate(java.lang.String inTerm, boolean showDetails)
          A method to get the normalized strings of an input string along with details information of norm operations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NormApi

public NormApi()
Creates a NormApi object and initiate related data (default).

CleanUp( ) method must be called to close Db connection after using this object


NormApi

public NormApi(java.lang.String configFile)
Creates a NormApi object and initiate related data using a specified configuration file.

CleanUp( ) method must be called to close Db connection after using this object

Parameters:
configFile - the absolute path of the configuration file

NormApi

public NormApi(java.util.Hashtable<java.lang.String,java.lang.String> properties)
Creates a NormApi object and initiate related data with properties needs to be overwritten

CleanUp( ) method must be called to close Db connection after using this object

Parameters:
properties - properties to be overwritten in config

NormApi

public NormApi(java.lang.String configFile,
               java.util.Hashtable<java.lang.String,java.lang.String> properties)
Creates a NormApi object and initiate related data using a specified configuration file with properties to be wverwritten.

CleanUp( ) method must be called to close Db connection after using this object

Parameters:
configFile - the absolute path of the configuration file
properties - properties to be overwritten in config

NormApi

public NormApi(java.sql.Connection conn,
               RamTrie ramTrieI)
Creates a NormApi object and initiate related data using specified database connection and persistent trie.

CleanUp( ) method must be called to close Db connection after using this object

Parameters:
conn - database connection
ramTrieI - persistent trie for inflectional morphology
Method Detail

Mutate

public java.util.Vector<LexItem> Mutate(LexItem in)
                                 throws java.lang.Exception
A method to get the normalized strings of an input LexItem

Parameters:
in - an input LexItem to be mutated
Returns:
Vector - normalized results
Throws:
java.lang.Exception

Mutate

public java.util.Vector<java.lang.String> Mutate(java.lang.String inTerm)
                                          throws java.lang.Exception
A method to get the normalized strings of an input string

Parameters:
inTerm - an input term in a string format to be mutated
Returns:
Vector - normalized results
Throws:
java.lang.Exception

Mutate

public java.util.Vector<LexItem> Mutate(java.lang.String inTerm,
                                        boolean showDetails)
                                 throws java.lang.Exception
A method to get the normalized strings of an input string along with details information of norm operations

Parameters:
inTerm - an input term in a string format to be mutated
showDetails - a boolean flag of showing details
Returns:
Vector - normalized results
Throws:
java.lang.Exception

CleanUp

public void CleanUp()
Close Lvg database connection and persistent tries. This methods must be called before exiting LvgApi. It is a method from postprocess.


GetConfiguration

public Configuration GetConfiguration()
A method to get the configuration object

Returns:
Configuration

GetConnection

public java.sql.Connection GetConnection()
A method to get the established database connection

Returns:
database connection

GetTrie

public RamTrie GetTrie()
A method to get the persistent trie for inflectional morphology

Returns:
persistent trie for inflectional morphology

Lvg Java
2011 Version

Submit a bug or feature

Copyright © 2011 National Library of Medicine