Lvg Java
2006p Version

gov.nih.nlm.nls.lvg.Flows
Class Transformation

java.lang.Object
  extended by gov.nih.nlm.nls.lvg.Flows.Transformation
Direct Known Subclasses:
ToAcronyms, ToAntiNorm, ToBaseSpellingVariants, ToCanonicalize, ToCitation, ToConvertOutput, ToDerivation, ToDerivationByCategory, ToExpansions, ToFilter, ToFilterAcronym, ToFilterProperNoun, ToFruitfulEnhanced, ToFruitfulVariants, ToFruitfulVariantsDb, ToFruitfulVariantsLex, ToInflection, ToInflectionByCatInfl, ToInflectionSimple, ToLowerCase, ToLuiNormalize, ToMetaphone, ToNominalization, ToNoOperation, ToNormalize, ToNormalizeChar, ToNormalizeCharSynonym, ToNormUninflectWords, ToRecursiveDerivations, ToRecursiveSynonyms, ToRemoveGenitive, ToRemoveS, ToReplacePunctuationWithSpace, ToRetrieveCatInfl, ToRetrieveCatInflBegin, ToRetrieveCatInflDb, ToRetrieveEui, ToSimpleInflections, ToSortWordsByOrder, ToSpellingVariants, ToSplitLigatures, ToStripAmbiguityTags, ToStripDiacritics, ToStripNecNos, ToStripPunctuation, ToStripPunctuationEnhanced, ToStripStopWords, ToSymbolNames, ToSymbolNameSynonym, ToSynonyms, ToSyntacticUninvert, ToTokenize, ToTokenizeKeepAll, ToTokenizeNoHyphens, ToUninflectTerm, ToUninflectWords, ToUninvert, ToWordSize

public abstract class Transformation
extends java.lang.Object

This class provides the base class for Lvg flow components. Classes of all Lvg flow components are extended from this Transformation class. It contains some common public methods, such as UpdateFlowHistory( ), GetResults( ), and Mutate( ).

History:

Version:
V-2006p
Author:
NLM NLS Development Team
See Also:
Design Document

Field Summary
static java.lang.String NO_MUTATE_INFO
          A global definition for no mutation information
static int UPDATE
          a numberical flag used in UpdateLexItem( ) method to set the categories or inflections to all bits or source bit if the source bit is or is not 0
 
Constructor Summary
Transformation()
           
 
Method Summary
static java.lang.String GetTestStr(java.lang.String[] args, java.lang.String defaultStr)
          Get the string to be tested (transformed).
protected static void PrintResult(LexItem out, int flowNum, boolean mutateFlag)
          Print the string representation of the transformation results.
protected static void PrintResults(LexItem in, java.util.Vector outs)
          Print the input and outputs for the current flow component.
protected static LexItem UpdateLexItem(LexItem in, int flowBit, long category, long inflection, java.lang.String details, java.lang.String mutateInfo)
          Update data for a LexItem.
protected static LexItem UpdateLexItem(LexItem in, java.lang.String target, int flowBit, long category, long inflection, java.lang.String details, java.lang.String mutateInfo)
          Update data for a LexItem.
protected static LexItem UpdateLexItem(LexItem in, java.lang.String target, java.lang.String flowName, long category, long inflection, java.lang.String details, java.lang.String mutateInfo, boolean appendFlowFlag)
          Update data for a LexItem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPDATE

public static final int UPDATE
a numberical flag used in UpdateLexItem( ) method to set the categories or inflections to all bits or source bit if the source bit is or is not 0

See Also:
Constant Field Values

NO_MUTATE_INFO

public static final java.lang.String NO_MUTATE_INFO
A global definition for no mutation information

Constructor Detail

Transformation

public Transformation()
Method Detail

GetTestStr

public static java.lang.String GetTestStr(java.lang.String[] args,
                                          java.lang.String defaultStr)
Get the string to be tested (transformed).

Parameters:
args - an input string from the command line
defaultStr - a program default string
Returns:
the string to be tested (transformed)

PrintResult

protected static void PrintResult(LexItem out,
                                  int flowNum,
                                  boolean mutateFlag)
Print the string representation of the transformation results.

Parameters:
out - an output LexItem of a transformation
flowNum - flow number, a number indicates which flow produced the output
mutateFlag - a boolean flag is used to append or not the mutate information if the value is true or false.

UpdateLexItem

protected static LexItem UpdateLexItem(LexItem in,
                                       java.lang.String target,
                                       java.lang.String flowName,
                                       long category,
                                       long inflection,
                                       java.lang.String details,
                                       java.lang.String mutateInfo,
                                       boolean appendFlowFlag)
Update data for a LexItem. This method must be called after the transformation of a Lvg flow component.

Parameters:
in - the LexItem to be updated
target - target term for updating
flowName - the abbreviation name of the flow component of the tranformation
category - category to be assigned. if the value is UPDATE, the category will assigned to all bits or source if the source is or is not 0
inflection - inflection to be assigned. if the value is UPDATE, the category will assigned to all bits or source if the source is or is not 0
details - the detail transform information for all flow components in a flow
mutateInfo - the addition mutate information for a flow component. The infomation on the last flow component will be used if there are more than one flow component in the flow.
appendFlowFlag - a flag for appending flow history
Returns:
an LexItem with updated data.

UpdateLexItem

protected static LexItem UpdateLexItem(LexItem in,
                                       java.lang.String target,
                                       int flowBit,
                                       long category,
                                       long inflection,
                                       java.lang.String details,
                                       java.lang.String mutateInfo)
Update data for a LexItem. This method must be called after the transformation of a Lvg flow component.

Parameters:
in - the LexItem to be updated
target - target term for updating
flowBit - the bit number of the flow component of the tranformation
category - category to be assigned. if the value is UPDATE, the category will assigned to all bits or source if the source is or is not 0
inflection - inflection to be assigned. if the value is UPDATE, the category will assigned to all bits or source if the source is or is not 0
details - the detail transform information for all flow components in a flow
mutateInfo - the addition mutate information for a flow component. The infomation on the last flow component will be used if there are more than one flow component in the flow.
Returns:
an LexItem with updated data.

UpdateLexItem

protected static LexItem UpdateLexItem(LexItem in,
                                       int flowBit,
                                       long category,
                                       long inflection,
                                       java.lang.String details,
                                       java.lang.String mutateInfo)
Update data for a LexItem. This method sets category, inflection, detail information, and mutate information for a given LexItem.

Parameters:
in - the LexItem to be updated
flowBit - the bit number of the flow component
category - category to be assigned
inflection - inflection to be assigned
details - the detail transform information for all flow components in a flow
mutateInfo - the addition mutate information for a flow component. The infomation on the last flow component will be used if there are more than one flow component in the flow.
Returns:
an LexItem with updated data.

PrintResults

protected static void PrintResults(LexItem in,
                                   java.util.Vector outs)
Print the input and outputs for the current flow component.

Parameters:
in - input of current flow component
outs - outputs of current flow component

Lvg Java
2006p Version

Submit a bug or feature

Copyright © 2006p National Library of Medicine