Lvg Java
2011 Version

gov.nih.nlm.nls.lvg.Lib
Class LexItem

java.lang.Object
  extended by gov.nih.nlm.nls.lvg.Lib.LexItem

public class LexItem
extends java.lang.Object

This class provides the base element of LVG, LexItem. All Lvg operations, such as flow component and filter options use LexItems as units of inputs and outputs.

History:

Version:
V-2011
Author:
NLM NLS Development Team

Constructor Summary
LexItem()
          Create a default LexItem object
LexItem(LexItem in, boolean allFlag)
          Create a default LexItem object, using a specified LexItem and a flag of inheriting properties from the specified LexItem.
LexItem(java.lang.String term)
          Create a default LexItem object, using a specified term
LexItem(java.lang.String term, long cat)
          Create a default LexItem object, using a specified term and category
LexItem(java.lang.String term, long cat, long infl)
          Create a default LexItem object, using a specified term, category, and inflection
 
Method Summary
 java.lang.String GetDetailInformation()
          Get the detail information of current LexItem.
 int GetFlowComponentNumber()
          Get the flow component number of current LexItem.
 java.lang.String GetFlowHistory()
          Get the flow history of current LexItem.
 int GetFlowNumber()
          Get the flow number of current LexItem.
 java.lang.String GetMutateInformation()
          Get the mutate information of current LexItem.
 java.lang.String GetOriginalTerm()
          Get the original term of current LexItem.
static java.lang.String GetResultString(LexItem in, java.lang.String originalTerm, boolean mutateFlag, int caseFlag, boolean showCategoryStrFlag, boolean showInflectionStrFlag, boolean filterInputFlag, java.lang.String separator)
          Get the string representation of the transformation results.
 Category GetSourceCategory()
          Get the source category of current LexItem.
 Gender GetSourceGender()
          Get the source gender of current LexItem.
 Inflection GetSourceInflection()
          Get the source inflection of current LexItem.
 java.lang.String GetSourceTerm()
          Get the source term of current LexItem.
 long GetTag()
          Get the tag information of current LexItem.
 Category GetTargetCategory()
          Get the target category of current LexItem.
 Gender GetTargetGender()
          Get the target gender of current LexItem.
 Inflection GetTargetInflection()
          Get the target inflection of current LexItem.
 java.lang.String GetTargetTerm()
          Get the target term of current LexItem.
static void main(java.lang.String[] args)
          A test driver for this class
 void SetDetailInformation(java.lang.String value)
          Set the detail information of current LexItem.
 void SetFlowComponentNumber(int flowComponentNum)
          Set the flow component number in a flow.
 void SetFlowHistory(java.lang.String value)
          Set the flow history of current LexItem.
 void SetFlowNumber(int flowNum)
          Set the flow number in pararell flows
 void SetMutateInformation(java.lang.String value)
          Set the mutate information of current LexItem.
 void SetOriginalTerm(java.lang.String value)
          Set the original term of current LexItem.
 void SetSourceCategory(long value)
          Set the source categeroy of current LexItem.
 void SetSourceInflection(long value)
          Set the source inflection of current LexItem.
 void SetSourceTerm(java.lang.String value)
          Set the source term of current LexItem.
 void SetTag(long value)
          Set the tag information of current LexItem.
 void SetTargetCategory(long value)
          Set the target category of current LexItem.
 void SetTargetInflection(long value)
          Set the target inflection of current LexItem.
 void SetTargetTerm(java.lang.String value)
          Set the target term of current LexItem.
static java.util.Vector<LexItem> TargetsToSources(java.util.Vector<LexItem> tars)
          This method change Vector of target (outputs from a flow component) to Vector of source (inputs for a flow component).
static LexItem TargetToSource(LexItem tar)
          This method change a target LexItem (output from a flow component) to a source LexItem (input for a flow component).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LexItem

public LexItem()
Create a default LexItem object


LexItem

public LexItem(java.lang.String term)
Create a default LexItem object, using a specified term


LexItem

public LexItem(java.lang.String term,
               long cat)
Create a default LexItem object, using a specified term and category


LexItem

public LexItem(java.lang.String term,
               long cat,
               long infl)
Create a default LexItem object, using a specified term, category, and inflection


LexItem

public LexItem(LexItem in,
               boolean allFlag)
Create a default LexItem object, using a specified LexItem and a flag of inheriting properties from the specified LexItem.

Method Detail

TargetToSource

public static LexItem TargetToSource(LexItem tar)
This method change a target LexItem (output from a flow component) to a source LexItem (input for a flow component). Such transfer methods must be used between a series of flow components operations in a flow.

Parameters:
tar - an LexItem that is the output of a flow component and to be changed as an input for next flow component.
Returns:
an LexItem for an input of a flow component

TargetsToSources

public static java.util.Vector<LexItem> TargetsToSources(java.util.Vector<LexItem> tars)
This method change Vector of target (outputs from a flow component) to Vector of source (inputs for a flow component). Such transfer methods must be used between a series of flow components operations in a flow.

Parameters:
tars - Vector of the outputs of a flow component and to be changed as the inputs for next flow component.
Returns:
Vector for the inputs of a flow component

SetOriginalTerm

public void SetOriginalTerm(java.lang.String value)
Set the original term of current LexItem. The original term is never changed during Lvg flow operations.

Parameters:
value - string value of the original term to be set.

SetSourceTerm

public void SetSourceTerm(java.lang.String value)
Set the source term of current LexItem. The source term is the term that Lvg flow component uses as input.

Parameters:
value - string value of the source term to be set.

SetTargetTerm

public void SetTargetTerm(java.lang.String value)
Set the target term of current LexItem. The target term is the term that come from the output of Lvg flow component.

Parameters:
value - string value of the target term to be set.

SetSourceCategory

public void SetSourceCategory(long value)
Set the source categeroy of current LexItem. The source category is the category of the source term of the LexItem.

Parameters:
value - a long integer value of the source category

SetTargetCategory

public void SetTargetCategory(long value)
Set the target category of current LexItem. The target category is the category of the target term of the LexItem.

Parameters:
value - a long integer value of the target category

SetSourceInflection

public void SetSourceInflection(long value)
Set the source inflection of current LexItem. The source inflection is the inflection of the source term of the LexItem.

Parameters:
value - a long integer value of the source inflection

SetTargetInflection

public void SetTargetInflection(long value)
Set the target inflection of current LexItem. The target inflection is the inflection of the target term of the LexItem.

Parameters:
value - a long integer value of the target inflection

SetDetailInformation

public void SetDetailInformation(java.lang.String value)
Set the detail information of current LexItem. The detail information contains all information of each flow component in a flow operation. This information can be used with option flag -d.

Parameters:
value - string value of the detail information to be set.

SetMutateInformation

public void SetMutateInformation(java.lang.String value)
Set the mutate information of current LexItem. The mutate information provides addition information for user to understand the flow operation. This information can be used with option flag -m.

Parameters:
value - string value of the mutate information to be set.

SetTag

public void SetTag(long value)
Set the tag information of current LexItem. The tag information provides addition information by mark a tag on the lexItem

Parameters:
value - integer value of the tag information to be set.

SetFlowHistory

public void SetFlowHistory(java.lang.String value)
Set the flow history of current LexItem. The flow history utilizes the combination of flow symbols (abbreviation names).

Parameters:
value - string value of the flow history to be set.

SetFlowNumber

public void SetFlowNumber(int flowNum)
Set the flow number in pararell flows

Parameters:
flowNum - an integer value of flow number

SetFlowComponentNumber

public void SetFlowComponentNumber(int flowComponentNum)
Set the flow component number in a flow. This is used in detail information.

Parameters:
flowComponentNum - an integer value of flow ocmponent number

GetOriginalTerm

public java.lang.String GetOriginalTerm()
Get the original term of current LexItem.

Returns:
string value of the original term from the current LexItem.

GetSourceTerm

public java.lang.String GetSourceTerm()
Get the source term of current LexItem.

Returns:
string value of the source term from the current LexItem.

GetSourceGender

public Gender GetSourceGender()
Get the source gender of current LexItem.

Returns:
string value of the source gender from the current LexItem.

GetTargetTerm

public java.lang.String GetTargetTerm()
Get the target term of current LexItem.

Returns:
string value of the target term from the current LexItem.

GetSourceCategory

public Category GetSourceCategory()
Get the source category of current LexItem.

Returns:
the source category object from the current LexItem.

GetTargetCategory

public Category GetTargetCategory()
Get the target category of current LexItem.

Returns:
the target category object from the current LexItem.

GetSourceInflection

public Inflection GetSourceInflection()
Get the source inflection of current LexItem.

Returns:
the source inflection object from the current LexItem.

GetTargetInflection

public Inflection GetTargetInflection()
Get the target inflection of current LexItem.

Returns:
the target inflection object from the current LexItem.

GetTargetGender

public Gender GetTargetGender()
Get the target gender of current LexItem.

Returns:
the target gender object from the current LexItem.

GetFlowHistory

public java.lang.String GetFlowHistory()
Get the flow history of current LexItem.

Returns:
string value of the flow history from the current LexItem.

GetDetailInformation

public java.lang.String GetDetailInformation()
Get the detail information of current LexItem.

Returns:
string value of the detail information from the current LexItem.

GetTag

public long GetTag()
Get the tag information of current LexItem.

Returns:
integer value of the tag information from the current LexItem.

GetMutateInformation

public java.lang.String GetMutateInformation()
Get the mutate information of current LexItem.

Returns:
string value of the mutate information from the current LexItem.

GetFlowNumber

public int GetFlowNumber()
Get the flow number of current LexItem.

Returns:
flow number of the current LexItem in this flow

GetFlowComponentNumber

public int GetFlowComponentNumber()
Get the flow component number of current LexItem.

Returns:
flow component number of the current LexItem in this flow

GetResultString

public static java.lang.String GetResultString(LexItem in,
                                               java.lang.String originalTerm,
                                               boolean mutateFlag,
                                               int caseFlag,
                                               boolean showCategoryStrFlag,
                                               boolean showInflectionStrFlag,
                                               boolean filterInputFlag,
                                               java.lang.String separator)
Get the string representation of the transformation results.

Parameters:
in - an output LexItem of a transformation
originalTerm - the original input line (term)
mutateFlag - a boolean flag is used to append or not the mutate information if the value is true or false.
caseFlag - a int flag of modifying case on the output
showCategoryStrFlag - a boolean flag of showing categories in name
showInflectionStrFlag - a boolean flag of showing inflections in name
filterInputFlag - a boolean flag of filtering out addition fields from the input line.
separator - field separator in String
Returns:
the string representation of the transformation results (LexItem) The format is:
Input|Output|Categories|Inflections|Flow History|Flow Number|Mutate Information|

main

public static void main(java.lang.String[] args)
A test driver for this class


Lvg Java
2011 Version

Submit a bug or feature

Copyright © 2011 National Library of Medicine