gov.nih.nlm.nls.nlp.textfeatures
Class Candidate

java.lang.Object
  extended by gov.nih.nlm.nls.nlp.textfeatures.MmObject
      extended by gov.nih.nlm.nls.nlp.textfeatures.Candidate
All Implemented Interfaces:
java.io.Serializable

public final class Candidate
extends MmObject

Candidate Wed Oct 11 10:33:18 EDT 2000, mork Initial Version

Version:
$Id: Candidate.java,v 1.24 2005/08/24 19:17:52 divita Exp $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.nih.nlm.nls.nlp.textfeatures.MmObject
serialVersionUID
 
Constructor Summary
Candidate(Candidate aCandidate, int refCandidatePos, int sizeOfPhrase, boolean DEBUG)
          This is a constructor for Candidate
Candidate(java.lang.String NMSTR, java.lang.String STR, int distance, int phrasePos, boolean DEBUG)
          This is a constructor for Candidate
Candidate(java.lang.String SUI, java.lang.String NMSTR, java.lang.String STR, int distance, int phrasePos, boolean DEBUG)
          This is a constructor for Candidate
Candidate(java.lang.String SUI, java.lang.String NMSTR, java.lang.String STR, java.lang.String CONCEPT, int distance, int phrasePos, boolean DEBUG)
          This is a constructor for Candidate
 
Method Summary
 void addMatchedToken(Token pToken, java.util.List pPartialCandidateTokens)
          addMatchedToken adds a token of a Phrase that participated within a match from this candidate to the Phrase This token is the original element from the Phrase.
 void addMatchedVariant(Variant pVariant, java.util.List pPartialCandidateWordTokens)
          addMatchedVariant adds to a list of the matched variants that directly participated in this match, and the matching candidate word.
 void addMatchMap(MatchMap aMatchMap)
          addMatchMap adds a derived phrase to the set of derived phrases.
 void addToCandidate(Candidate aCandidate, int refCandidatePos, int sizeOfPhrase)
          Method addToCandidate is a FinalCandidate method that concatinates Candidates when forming a FinalCandidate.
 void computeCohesiveness(int sizeOfPhrase, gov.nih.nlm.nls.utils.GlobalBehavior settings)
          Method computeCohesiveness The cohesiveness value is similar to the coverage value but emphasizes the importance of connected components.
 void computeCoverage(int sizeOfPhrase)
          Method computeCoverage The coverage value indicates how much of the phrase string and the Metathesaurus string are involved in the match.
 void computeFinalCohesiveness(Phrase aPhrase, int sizeOfPhrase, gov.nih.nlm.nls.utils.GlobalBehavior settings)
          Method computeFinalCohesiveness The cohesiveness value is similar to the coverage value but emphasizes the importance of connected components.
 void computeFinalScore(gov.nih.nlm.nls.utils.GlobalBehavior settings, boolean strFlag)
          Method computeFinalScore Now that we have computed all of the component values - we combine them all into the final score with the proper weighting.
 void computeFinalScore(gov.nih.nlm.nls.utils.GlobalBehavior settings, boolean pIsExactMatch, boolean strFlag)
          Method computeFinalScore Now that we have computed all of the component values - we combine them all into the final score with the proper weighting.
 void computeInvolvement(int sizeOfPhrase)
          Method computeInvolvement The coverage value indicates how much of the phrase string and the Metathesaurus string are involved in the match.
 void computeVariation()
          Method computeVariation The variation value estimates how much the variants in the Metathesaurus string differ from the corresponding words in the phrase.
 boolean containsHead()
          Method containsHead returns whether this candidate's span includes the head of the query phrase.
 void doCandidatePosCheck(boolean flag)
          Method doCandidatePosCheck
 void doFinalScoring(gov.nih.nlm.nls.utils.GlobalBehavior settings, Phrase aPhrase, int sizeOfPhrase)
          Method doFinalScoring.
 boolean fillsOpening(Candidate aCandidate, int sizeOfPhrase, int candPos)
          Method fillsOpening This routine determines if the test candidate fits into the matchmap for this phrase.
 java.util.ArrayList findMatchingCandidateTokens(java.util.List pPartialCandidateWordTokens)
          findMatchingCandidateTokens retrieves a matching token from the tokenized Candidate.
 boolean getAddedNew()
          Method getAddedNew
 UMLSSourceInfo[] getAllSources()
          Method getAllSources retrieves all the sources for this cui of the candidate
 java.lang.String getAllSourcesList()
          Method getAllSourcesList retrieves all (unique) sources for this cui candidate in a comma separated list of source abbreviations
 int getCandidateScore()
          Method getCandidateScore Return the score computed matching the UMLS_String to the Phrase This will have the same result as the method getFinalScore().
 int getCentrality()
          Method getCentrality
 double getCohesiveness()
          Method getCohesiveness Return the Cohesiveness value for this candidate.
 java.lang.String getConcept()
          Method getConcept retrieves the concept name which is the preferred string of the preferred term of all the terms from the concept.
 double getCoverage()
          Method getCoverage Return the coverage value for this candidate.
 java.lang.String getCUI()
          Method getCUI
 int getCuiHash()
          Method getCuiHash retrieves the cui as an int.
 int getDistValue()
          Method getDistValue
 java.lang.String getFinal_strString()
          Method getFinal_strString is a FinalCandidate method that retrieves the combined Strings of the Candidates that make up this FinalCandidate
 int getFinalScore()
          Method getFinalScore Return the score computed matching the UMLS_String to the Phrase
 double getInvolvement()
          Method getInvolvement Return the involvement value for this candidate.
 java.lang.String getLOW()
          Method getLOW get List of words that make up the lowercased UMLS String.
 java.util.ArrayList getMatchedLexicalElements()
          getMatchedLexicalElements retrieves the lexicalElements of a Phrase that participated within a match from this candidate to the Phrase This lexical elements returned are the original elements from the Phrase.
 Token[] getMatchedTokens()
          getMatchedTokens retrieves the tokens of a Phrase that participated within a match from this candidate to the Phrase This tokens returned are the original tokens from the Phrase.
 java.util.ArrayList getMatchedVariants()
          getMatchedVariants retrieves the Variant|token mappings that participated in this match.
 java.util.Vector getMatchMaps()
          Method getMatchMaps returns the vector of lexical elements that make up the MatchMap list for this candidate.
 java.lang.String[] getMeshTreeCodes()
          Method getMeshTreeCodes
 int getMyCandSpan()
          Method getMyCandSpan
 int getMyPhraseSpan()
          Method getMyPhraseSpan
 java.lang.String getNumConnected()
          Method getNumConnected
 int getNumValidMaps()
          Method getNumValidMaps
 int getNumWords()
          Method getNumWords
 java.lang.String getPhraseNumConnected(int sizeOfPhrase)
          Method getPhraseNumConnected
 int getPhrasePos()
          Method getPhrasePos
 int getPosCheckSumValue()
          Method getPosCheckSumValue
 boolean getPosCheckValue(int pos)
          Method getPosCheckValue
 int getReferencePos()
          Method getReferencePos
 java.lang.String getRestrictedSourcesList(gov.nih.nlm.nls.utils.GlobalBehavior pSettings)
          Method getRestrictedSourcesList retrieves those (unique) sources for this cui candidate that are from the restrict to source list.
 UMLS_SemanticTypePointer[] getSemanticTypes()
          Method getSemanticTypes retrieve the Semantic Types
 java.lang.String getSemCode()
          Method getSemCode Return the Semantic Code for this candidate.
 java.lang.String getSemDefn()
          Method getSemDefn Return the Semantic Definition for this candidate.
 UMLSSourceInfo[] getSources()
          Method getSources retrieves valid sources for this sui|cui candidate
 java.lang.String getSourcesAndTermTypes()
          Method getSourcesAndTermTypes retrieves the (source|term type, ) pairs for this cui candidate in a comma separated list of term types.
 java.lang.String getSTR()
          Method getSTR retrieves the UMLS String Name for this candidate.
 java.lang.String getSUI()
          Method getSUI
 java.lang.String getSuis()
          Method getSuis retrieves suis, and if the sources have been retrieved, the sources of the suis
 java.util.Vector getTokens()
          getTokens retrieves the nlp.tokenized CandidateTokens that make up this candidate
 java.lang.String getTreeCodes()
          Method getTreeCodes
 java.lang.String getUMLS_ConceptName()
          Method getUMLS_ConceptName retrieves the UMLS Concept Name, which is the prefered string from the concept.
 UMLS_ConceptPointer getUMLS_ConceptPointer()
          Method getUMLS_ConceptPointer retrieves the UMLS_ConceptPointer from this candidate.
 UMLS_SemanticTypePointer[] getUMLS_SemanticTypes()
          Method getUMLS_SemanticTypes Return the Semantic Definition for this candidate.
 java.lang.String getUMLS_StringName()
          Method getUMLSStringName retrieves the UMLS String Name.
 UMLS_StringPointer getUMLS_StringPointer()
          Method getUMLS_StringPointer retrieves the UMLS_StringPointer from this candidate.
 java.lang.String getUMLSConceptName()
          Method getUMLSConceptName retrieves the concept name which is the preferred string of the preferred term of all the terms from the concept.
 UMLS_StringPointer getUMLSStringPointer()
          Method getUMLSStringPointer retrieves the candidate's reference to the UMLSStringPointer
 boolean getUsedAtAll()
          Method getUsedAtAll
 boolean getUsedLocally()
          Method getUsedLocally
 java.lang.String getValidSourcesList()
          Method getValidSourcesList retrieves valid (unique) sources for this cui|sui candidate in a comma separated list of source abbreviations
 double getVariation()
          Method getVariation Return the variation value for this candidate.
 boolean isCompleted(int sizeOfPhrase)
          Method isCompleted Determine whether we have finished completing the segment matching for this candidate.
 boolean isConceptGap(int sizeOfPhrase)
          Method isConceptGap A concept gap is defined as: A candidate with non-matching words occurring in the middle of the candidate.
 boolean isHead()
          Method isHead returns whether this candidate's span includes the head of the query phrase.
 boolean isInOrder(int sizeOfPhrase)
          Method isInOrder This verifies that the matches between the candidate and the phrase are done in the same left to right ordering.
 boolean isOverMatch(int sizeOfPhrase)
          Method isOverMatch An overmatch is defined as A candidate with non-matching words on one end of the candidate.
 boolean isPosAlreadySetinMatchMap(int pPos)
          Method isPosAlreadySetinMatchMap
 void printFieldedListing(int sizeOfPhrase, gov.nih.nlm.nls.utils.GlobalBehavior settings, java.lang.String prefix)
          Method printFieldedListing
 void printFinalNumConnectedString(int sizeOfPhrase, gov.nih.nlm.nls.utils.GlobalBehavior settings)
          Method printFinalNumConnectedString
 void printFullCandidate(Phrase aPhrase, gov.nih.nlm.nls.utils.GlobalBehavior settings)
          Method printFullCandidate
 void printListing(gov.nih.nlm.nls.utils.GlobalBehavior settings, boolean doNumsFlag, int numPos)
          Method printListing
 void printMatchMapDebugString(boolean nlFlag, gov.nih.nlm.nls.utils.GlobalBehavior settings)
          Method printMatchMapDebugString
 void printMoListing(int sizeOfPhrase, gov.nih.nlm.nls.utils.GlobalBehavior settings)
          Method printMoListing
 void printNumConnectedString(int sizeOfPhrase, gov.nih.nlm.nls.utils.GlobalBehavior settings)
          Method printNumConnectedString
 void setAddedNew(boolean flag)
          Method setAddedNew
 void setCentrality()
          Method setCentrality The centrality value is simply 1 if the string involves the head of the phrase and 0 otherwise.
 void setConcept(java.lang.String CONCEPT)
          Method setConcept
 void setCUI(java.lang.String CUI)
          Method setCUI
 void setCuiHash(int pCui)
          Method setCuiHash sets the cui as an int.
 void setIsHead(boolean flag)
          Method setIsHead
 void setNumConnected()
          Method setNumConnected
 void setNumValidMaps(int numValidMaps)
          Method setNumValidMaps
 void setNumWords(int numWords)
          Method setNumWords
 void setPosCheck(boolean[] posCheck, int sizeOfPhrase)
          Method setPosCheck NOTE: Setting up the posCheckSum as a binary counter/sum of what positions are actually set in posCheck.
 void setReferencePos(int referencePos)
          Method setReferencePos
 void setSemanticInfo(java.lang.String semCode, java.lang.String semDefn)
          Method setSemanticInfo Set the Semantic code and definition for this candidate.
 void setSemanticTypes(UMLS_SemanticTypePointer[] pSemanticTypes)
          Method setSemanticTypes Set the Semantic Types
 void setTokens(java.util.Vector pTokens)
          setTokens adds a set of CandidateTokens as tokenized by the nlp.tokenizer
 void setTreeCodes(java.lang.String TreeCodes)
          Method setTreeCodes
 void setTreeCodes(java.lang.String[] pTreeCodes)
          Method setTreeCodes
 void setUMLS_StringPointer(UMLS_StringPointer pStringPointer)
          Method setUMLS_StringPointer attaches a UMLS_StringPointer to this candidate.
 void setUMLSConceptPointer(UMLS_ConceptPointer pConceptPointer)
          Method setUMLS_ConceptPointer attaches a UMLS_ConceptPointer to this candidate.
 void setUsedAtAll(boolean flag)
          Method setUsedAtAll
 void setUsedLocally(boolean flag)
          Method setUsedLocally
 void sortMatchMap()
          Method sortMatchMap
 java.lang.String toMetaMapString()
          Method toMetaMapString
 java.lang.String toPipedString()
          Method toPipedString
 java.lang.String toString()
          toString will print finalScore|cui|ConceptName|String|SemanticType(s)|MeSHTreeNumber(s)|
 void toString(int sizeOfPhrase, gov.nih.nlm.nls.utils.GlobalBehavior settings)
          Method toString
 void toStringDebug(int sizeOfPhrase, gov.nih.nlm.nls.utils.GlobalBehavior settings)
          Method toStringDebug
 void updatePosCheck(int sizeOfPhrase)
          updatePosCheck
 
Methods inherited from class gov.nih.nlm.nls.nlp.textfeatures.MmObject
appendOriginalString, getCharOffset, getId, getLabel, getOriginalString, getSpan, getStrippedString, getTrimmedString, setId, setLabel, setOriginalString, setSpan, setStrippedString, setTrimmedString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Candidate

public Candidate(java.lang.String SUI,
                 java.lang.String NMSTR,
                 java.lang.String STR,
                 java.lang.String CONCEPT,
                 int distance,
                 int phrasePos,
                 boolean DEBUG)
This is a constructor for Candidate

Parameters:
SUI -
NMSTR -
STR -
CONCEPT -
distance -
phrasePos -
DEBUG -

Candidate

public Candidate(java.lang.String NMSTR,
                 java.lang.String STR,
                 int distance,
                 int phrasePos,
                 boolean DEBUG)
This is a constructor for Candidate

Parameters:
NMSTR -
STR -
distance -
phrasePos -
DEBUG -

Candidate

public Candidate(java.lang.String SUI,
                 java.lang.String NMSTR,
                 java.lang.String STR,
                 int distance,
                 int phrasePos,
                 boolean DEBUG)
This is a constructor for Candidate

Parameters:
SUI -
NMSTR -
STR -
distance -
phrasePos -
DEBUG -

Candidate

public Candidate(Candidate aCandidate,
                 int refCandidatePos,
                 int sizeOfPhrase,
                 boolean DEBUG)
This is a constructor for Candidate

Parameters:
aCandidate - A candidate to be copied.
refCandidatePos - A pointer into the candidate list.
sizeOfPhrase - The size of the parent NP phrase.
DEBUG -
Method Detail

getNumConnected

public java.lang.String getNumConnected()
Method getNumConnected

Returns:
String

getMyPhraseSpan

public int getMyPhraseSpan()
Method getMyPhraseSpan

Returns:
int

getMyCandSpan

public int getMyCandSpan()
Method getMyCandSpan

Returns:
int

getLOW

public java.lang.String getLOW()
Method getLOW get List of words that make up the lowercased UMLS String.

Returns:
String

getSTR

public java.lang.String getSTR()
Method getSTR retrieves the UMLS String Name for this candidate. This method does the same as the getUMLSStringName() method.

Returns:
String

getConcept

public java.lang.String getConcept()
Method getConcept retrieves the concept name which is the preferred string of the preferred term of all the terms from the concept. This method is the same as the getUMLSConceptName() method.

Returns:
String

getUMLSConceptName

public java.lang.String getUMLSConceptName()
Method getUMLSConceptName retrieves the concept name which is the preferred string of the preferred term of all the terms from the concept.

Returns:
String

setConcept

public void setConcept(java.lang.String CONCEPT)
Method setConcept

Parameters:
CONCEPT -

setUMLSConceptPointer

public void setUMLSConceptPointer(UMLS_ConceptPointer pConceptPointer)
Method setUMLS_ConceptPointer attaches a UMLS_ConceptPointer to this candidate.

Parameters:
pConceptPointer -

getUMLS_ConceptPointer

public UMLS_ConceptPointer getUMLS_ConceptPointer()
Method getUMLS_ConceptPointer retrieves the UMLS_ConceptPointer from this candidate.

Returns:
UMLS_ConceptPointer

getReferencePos

public int getReferencePos()
Method getReferencePos

Returns:
String

setReferencePos

public void setReferencePos(int referencePos)
Method setReferencePos

Parameters:
referencePos -

getCUI

public java.lang.String getCUI()
Method getCUI

Returns:
String

getSUI

public java.lang.String getSUI()
Method getSUI

Returns:
String

getTreeCodes

public java.lang.String getTreeCodes()
Method getTreeCodes

Returns:
String

setCUI

public void setCUI(java.lang.String CUI)
Method setCUI

Parameters:
CUI -

setCuiHash

public void setCuiHash(int pCui)
Method setCuiHash sets the cui as an int. This should be the cui with the "C" stripped off, and the 7 digits turned into an int.

Parameters:
pCui -

getCuiHash

public int getCuiHash()
Method getCuiHash retrieves the cui as an int. This should be the cui with the "C" stripped off, and the 7 digits turned into an int.

Returns:
int

setTreeCodes

public void setTreeCodes(java.lang.String TreeCodes)
Method setTreeCodes

Parameters:
TreeCodes -

setTreeCodes

public void setTreeCodes(java.lang.String[] pTreeCodes)
Method setTreeCodes

Parameters:
pTreeCodes -

getMeshTreeCodes

public java.lang.String[] getMeshTreeCodes()
Method getMeshTreeCodes

Returns:
String[]

getPhrasePos

public int getPhrasePos()
Method getPhrasePos

Returns:
int

getDistValue

public int getDistValue()
Method getDistValue

Returns:
int

getCentrality

public int getCentrality()
Method getCentrality

Returns:
int

addMatchMap

public void addMatchMap(MatchMap aMatchMap)
addMatchMap adds a derived phrase to the set of derived phrases.

Parameters:
aMatchMap -

addMatchedVariant

public void addMatchedVariant(Variant pVariant,
                              java.util.List pPartialCandidateWordTokens)
addMatchedVariant adds to a list of the matched variants that directly participated in this match, and the matching candidate word. The list of candidate tokens is searched to find the corresponding candidate word so that we have a object instance match between the variant instance and the nlp tokenized candidate token. This method creates VariantConceptTokenMapping's to keep these mappings.

Parameters:
pVariant -
pPartialCandidateWordTokens -

getMatchedLexicalElements

public java.util.ArrayList getMatchedLexicalElements()
getMatchedLexicalElements retrieves the lexicalElements of a Phrase that participated within a match from this candidate to the Phrase This lexical elements returned are the original elements from the Phrase. The match may have happened from a variants that are contained within the LexicalElement. This method is only valid when the flag --matchMapNeeded is turned on so that the matchedVariants gets populated.

Returns:
ArrayList of LexicalElement

getMatchedVariants

public java.util.ArrayList getMatchedVariants()
getMatchedVariants retrieves the Variant|token mappings that participated in this match.

Returns:
ArrayList of VariantConceptTokenMapping

findMatchingCandidateTokens

public java.util.ArrayList findMatchingCandidateTokens(java.util.List pPartialCandidateWordTokens)
findMatchingCandidateTokens retrieves a matching token from the tokenized Candidate.

Parameters:
pPartialCandidateWordTokens -
Returns:
ArrayList of Token

addMatchedToken

public void addMatchedToken(Token pToken,
                            java.util.List pPartialCandidateTokens)
addMatchedToken adds a token of a Phrase that participated within a match from this candidate to the Phrase This token is the original element from the Phrase.

Parameters:
pToken -
pPartialCandidateTokens -

getMatchedTokens

public Token[] getMatchedTokens()
getMatchedTokens retrieves the tokens of a Phrase that participated within a match from this candidate to the Phrase This tokens returned are the original tokens from the Phrase.

Returns:
Token[]

setTokens

public void setTokens(java.util.Vector pTokens)
setTokens adds a set of CandidateTokens as tokenized by the nlp.tokenizer

Parameters:
pTokens -

getTokens

public java.util.Vector getTokens()
getTokens retrieves the nlp.tokenized CandidateTokens that make up this candidate

Returns:
Vector

updatePosCheck

public void updatePosCheck(int sizeOfPhrase)
updatePosCheck

Parameters:
sizeOfPhrase -

getMatchMaps

public final java.util.Vector getMatchMaps()
Method getMatchMaps returns the vector of lexical elements that make up the MatchMap list for this candidate.

Returns:
Vector of matchMaps

getNumWords

public int getNumWords()
Method getNumWords

Returns:
int

setNumWords

public void setNumWords(int numWords)
Method setNumWords

Parameters:
numWords - Number of words in the NMSTR for this candidate.

getNumValidMaps

public int getNumValidMaps()
Method getNumValidMaps

Returns:
int

setNumValidMaps

public void setNumValidMaps(int numValidMaps)
Method setNumValidMaps

Parameters:
numValidMaps - Number of valid maps for this candidate.

setIsHead

public void setIsHead(boolean flag)
Method setIsHead

Parameters:
flag - Whether this candidate's span includes the head.

setCentrality

public void setCentrality()
Method setCentrality The centrality value is simply 1 if the string involves the head of the phrase and 0 otherwise. This routine inspects the "isHead" and sets the centrality accordingly.


setPosCheck

public void setPosCheck(boolean[] posCheck,
                        int sizeOfPhrase)
Method setPosCheck NOTE: Setting up the posCheckSum as a binary counter/sum of what positions are actually set in posCheck.

Parameters:
posCheck -
sizeOfPhrase -

getPosCheckValue

public boolean getPosCheckValue(int pos)
Method getPosCheckValue

Parameters:
pos - Position of posCheck to return value for.
Returns:
boolean

getFinal_strString

public java.lang.String getFinal_strString()
Method getFinal_strString is a FinalCandidate method that retrieves the combined Strings of the Candidates that make up this FinalCandidate

Returns:
String

getPosCheckSumValue

public int getPosCheckSumValue()
Method getPosCheckSumValue

Returns:
int

isHead

public boolean isHead()
Method isHead returns whether this candidate's span includes the head of the query phrase.

Returns:
boolean

containsHead

public boolean containsHead()
Method containsHead returns whether this candidate's span includes the head of the query phrase. This is the same method as isHead().

Returns:
boolean

isInOrder

public boolean isInOrder(int sizeOfPhrase)
Method isInOrder This verifies that the matches between the candidate and the phrase are done in the same left to right ordering. This is a default condition whereas if the user specifies "ignore word order" we won't call this routine.

Parameters:
sizeOfPhrase - Number of words in parent phrase.
Returns:
boolean

isOverMatch

public boolean isOverMatch(int sizeOfPhrase)
Method isOverMatch An overmatch is defined as A candidate with non-matching words on one end of the candidate.

Parameters:
sizeOfPhrase - Number of words in parent phrase.
Returns:
boolean

doCandidatePosCheck

public void doCandidatePosCheck(boolean flag)
Method doCandidatePosCheck

Parameters:
flag -

setNumConnected

public void setNumConnected()
Method setNumConnected


isConceptGap

public boolean isConceptGap(int sizeOfPhrase)
Method isConceptGap A concept gap is defined as: A candidate with non-matching words occurring in the middle of the candidate. By definition a 1 word phrase or a one word candidate can't possibly have a Concept Gap.

Parameters:
sizeOfPhrase - Number of words in parent phrase.
Returns:
boolean

computeVariation

public void computeVariation()
Method computeVariation The variation value estimates how much the variants in the Metathesaurus string differ from the corresponding words in the phrase. It is computed by first determining the variation distance for each variant in the Metathesaurus string. This distance is the sum of the distance values for each step taken during variant generation. V=4/(D+4) The final variation value for the candidate is the average fo the values for each of the variants.


getVariation

public double getVariation()
Method getVariation Return the variation value for this candidate.

Returns:
double

computeCoverage

public void computeCoverage(int sizeOfPhrase)
Method computeCoverage The coverage value indicates how much of the phrase string and the Metathesaurus string are involved in the match. In order to compute the value, the number of words participating in the match is computed for both the phrase and the Metathesaurus string. These numbers are called the phrase span and Metathesaurus span, respectively. NOTE: Gaps are ignored in this calculation. The coverage value for the phrase is the phrase span divided by the length of the phrase. Similarly, the coverage value for the Metathesaurus string is the Metathesaurus span divided by the length of the string. The final coverage value is the weighted average of the values for the phrase and the Metathesaurus string where the Metathesaurus string is given twice the weight as the phrase.

Parameters:
sizeOfPhrase - Number of words in parent phrase.

getCoverage

public double getCoverage()
Method getCoverage Return the coverage value for this candidate.

Returns:
double

computeInvolvement

public void computeInvolvement(int sizeOfPhrase)
Method computeInvolvement The coverage value indicates how much of the phrase string and the Metathesaurus string are involved in the match. In order to compute the value, the number of words participating in the match is computed for both the phrase and the Metathesaurus string. These numbers are called the phrase span and Metathesaurus span, respectively. NOTE: Gaps are ignored in this calculation. The coverage value for the phrase is the phrase span divided by the length of the phrase. Similarly, the coverage value for the Metathesaurus string is the Metathesaurus span divided by the length of the string. The final coverage value is the weighted average of the values for the phrase and the Metathesaurus string where the Metathesaurus string is given twice the weight as the phrase.

Parameters:
sizeOfPhrase - Number of words in parent phrase.

getInvolvement

public double getInvolvement()
Method getInvolvement Return the involvement value for this candidate.

Returns:
double

computeCohesiveness

public void computeCohesiveness(int sizeOfPhrase,
                                gov.nih.nlm.nls.utils.GlobalBehavior settings)
Method computeCohesiveness The cohesiveness value is similar to the coverage value but emphasizes the importance of connected components. A connected component is a maximal sequence of contiguous words participating in the match. The connected components for both the phrase and the Metathesaurus string are computed. The cohesiveness value for the phrase is the sum of the squares of the connected phrase component sizes divided by the square of the length of the string. A similar cohesiveness value is computed for the Metathesaurus string. The final cohesiveness value is the weighted average of the phrase and Metathesaurus string values where the Metathesaurus string is again given twice the weight as the phrase.

Parameters:
sizeOfPhrase - Number of words in parent phrase.
settings -

computeFinalCohesiveness

public void computeFinalCohesiveness(Phrase aPhrase,
                                     int sizeOfPhrase,
                                     gov.nih.nlm.nls.utils.GlobalBehavior settings)
Method computeFinalCohesiveness The cohesiveness value is similar to the coverage value but emphasizes the importance of connected components. A connected component is a maximal sequence of contiguous words participating in the match. The connected components for both the phrase and the Metathesaurus string are computed. The cohesiveness value for the phrase is the sum of the squares of the connected phrase component sizes divided by the square of the length of the string. A similar cohesiveness value is computed for the Metathesaurus string - EXCEPT the components are simply the squars of the lengths of the term participating in the mapping. The final cohesiveness value is the weighted average of the phrase and Metathesaurus string values where the Metathesaurus string is again given twice the weight as the phrase.

Parameters:
aPhrase -
sizeOfPhrase -
settings -

getCohesiveness

public double getCohesiveness()
Method getCohesiveness Return the Cohesiveness value for this candidate.

Returns:
double

computeFinalScore

public void computeFinalScore(gov.nih.nlm.nls.utils.GlobalBehavior settings,
                              boolean strFlag)
Method computeFinalScore Now that we have computed all of the component values - we combine them all into the final score with the proper weighting. NOTE: We don't have separate calculations for final score depending on the ignore_word_order use of involvement! We rely on the fact that coverage or involvement are set to 0.0 by default and will cancel themselves out in the equation below as necessary.

Parameters:
settings -
strFlag -

computeFinalScore

public void computeFinalScore(gov.nih.nlm.nls.utils.GlobalBehavior settings,
                              boolean pIsExactMatch,
                              boolean strFlag)
Method computeFinalScore Now that we have computed all of the component values - we combine them all into the final score with the proper weighting. NOTE: We don't have separate calculations for final score depending on the ignore_word_order use of involvement! We rely on the fact that coverage or involvement are set to 0.0 by default and will cancel themselves out in the equation below as necessary. However, if it is known beforehand that this is an exact match, make the final score 1000, regardless of the weighting.

Parameters:
settings -
pIsExactMatch -
strFlag -

getFinalScore

public int getFinalScore()
Method getFinalScore Return the score computed matching the UMLS_String to the Phrase

Returns:
int

getCandidateScore

public int getCandidateScore()
Method getCandidateScore Return the score computed matching the UMLS_String to the Phrase This will have the same result as the method getFinalScore().

Returns:
int

doFinalScoring

public void doFinalScoring(gov.nih.nlm.nls.utils.GlobalBehavior settings,
                           Phrase aPhrase,
                           int sizeOfPhrase)
Method doFinalScoring. This is a FinalCandidate method. This candidate made the final cut and is a final candidate - now we need to update it's scoring.

Parameters:
settings -
aPhrase -
sizeOfPhrase -

setSemanticInfo

public void setSemanticInfo(java.lang.String semCode,
                            java.lang.String semDefn)
Method setSemanticInfo Set the Semantic code and definition for this candidate.

Parameters:
semCode -
semDefn -

setSemanticTypes

public void setSemanticTypes(UMLS_SemanticTypePointer[] pSemanticTypes)
Method setSemanticTypes Set the Semantic Types

Parameters:
pSemanticTypes -

getSemanticTypes

public UMLS_SemanticTypePointer[] getSemanticTypes()
Method getSemanticTypes retrieve the Semantic Types

Returns:
UMLS_SemanticTypePointer[]

getUMLS_StringName

public java.lang.String getUMLS_StringName()
Method getUMLSStringName retrieves the UMLS String Name. This is the same as the getSTR method.

Returns:
String of the UMLS String

setUMLS_StringPointer

public void setUMLS_StringPointer(UMLS_StringPointer pStringPointer)
Method setUMLS_StringPointer attaches a UMLS_StringPointer to this candidate.

Parameters:
pStringPointer -

getUMLS_StringPointer

public UMLS_StringPointer getUMLS_StringPointer()
Method getUMLS_StringPointer retrieves the UMLS_StringPointer from this candidate.

Returns:
UMLS_StringPointer

getUMLS_ConceptName

public java.lang.String getUMLS_ConceptName()
Method getUMLS_ConceptName retrieves the UMLS Concept Name, which is the prefered string from the concept. This is the same as the getConcept method.

Returns:
String

getSemCode

public java.lang.String getSemCode()
Method getSemCode Return the Semantic Code for this candidate.

Returns:
String

getSemDefn

public java.lang.String getSemDefn()
Method getSemDefn Return the Semantic Definition for this candidate.

Returns:
String

getUMLS_SemanticTypes

public UMLS_SemanticTypePointer[] getUMLS_SemanticTypes()
Method getUMLS_SemanticTypes Return the Semantic Definition for this candidate.

Returns:
UMLS_SemanticTypePointer[]

setAddedNew

public void setAddedNew(boolean flag)
Method setAddedNew

Parameters:
flag - Determines true/false

setUsedLocally

public void setUsedLocally(boolean flag)
Method setUsedLocally

Parameters:
flag - Determines true/false

setUsedAtAll

public void setUsedAtAll(boolean flag)
Method setUsedAtAll

Parameters:
flag - - Determines true/false

getAddedNew

public boolean getAddedNew()
Method getAddedNew

Returns:
boolean

getUsedLocally

public boolean getUsedLocally()
Method getUsedLocally

Returns:
boolean

getUsedAtAll

public boolean getUsedAtAll()
Method getUsedAtAll

Returns:
boolean

fillsOpening

public boolean fillsOpening(Candidate aCandidate,
                            int sizeOfPhrase,
                            int candPos)
Method fillsOpening This routine determines if the test candidate fits into the matchmap for this phrase.

Parameters:
aCandidate - Compare against
sizeOfPhrase - Size of parent phrase trying to fill
candPos - Position in the candidate phrase
Returns:
boolean

addToCandidate

public void addToCandidate(Candidate aCandidate,
                           int refCandidatePos,
                           int sizeOfPhrase)
Method addToCandidate is a FinalCandidate method that concatinates Candidates when forming a FinalCandidate.

Parameters:
aCandidate -
refCandidatePos -
sizeOfPhrase -

sortMatchMap

public void sortMatchMap()
Method sortMatchMap


isCompleted

public boolean isCompleted(int sizeOfPhrase)
Method isCompleted Determine whether we have finished completing the segment matching for this candidate.

Parameters:
sizeOfPhrase - Size of parent phrase trying to fill
Returns:
boolean

isPosAlreadySetinMatchMap

public boolean isPosAlreadySetinMatchMap(int pPos)
Method isPosAlreadySetinMatchMap

Parameters:
pPos -
Returns:
boolean

printMatchMapDebugString

public void printMatchMapDebugString(boolean nlFlag,
                                     gov.nih.nlm.nls.utils.GlobalBehavior settings)
Method printMatchMapDebugString

Parameters:
nlFlag -
settings -

printNumConnectedString

public void printNumConnectedString(int sizeOfPhrase,
                                    gov.nih.nlm.nls.utils.GlobalBehavior settings)
Method printNumConnectedString

Parameters:
sizeOfPhrase -
settings -

printFinalNumConnectedString

public void printFinalNumConnectedString(int sizeOfPhrase,
                                         gov.nih.nlm.nls.utils.GlobalBehavior settings)
Method printFinalNumConnectedString

Parameters:
sizeOfPhrase -
settings -

getPhraseNumConnected

public java.lang.String getPhraseNumConnected(int sizeOfPhrase)
Method getPhraseNumConnected

Parameters:
sizeOfPhrase -
Returns:
String

printListing

public void printListing(gov.nih.nlm.nls.utils.GlobalBehavior settings,
                         boolean doNumsFlag,
                         int numPos)
Method printListing

Parameters:
settings -
doNumsFlag -
numPos -

printMoListing

public void printMoListing(int sizeOfPhrase,
                           gov.nih.nlm.nls.utils.GlobalBehavior settings)
Method printMoListing

Parameters:
sizeOfPhrase -
settings -

printFieldedListing

public void printFieldedListing(int sizeOfPhrase,
                                gov.nih.nlm.nls.utils.GlobalBehavior settings,
                                java.lang.String prefix)
Method printFieldedListing

Parameters:
sizeOfPhrase -
settings -
prefix -

toString

public void toString(int sizeOfPhrase,
                     gov.nih.nlm.nls.utils.GlobalBehavior settings)
Method toString

Parameters:
sizeOfPhrase -
settings -

toString

public java.lang.String toString()
toString will print finalScore|cui|ConceptName|String|SemanticType(s)|MeSHTreeNumber(s)|

Overrides:
toString in class MmObject
Returns:
String

toStringDebug

public void toStringDebug(int sizeOfPhrase,
                          gov.nih.nlm.nls.utils.GlobalBehavior settings)
Method toStringDebug

Parameters:
sizeOfPhrase -
settings -

printFullCandidate

public void printFullCandidate(Phrase aPhrase,
                               gov.nih.nlm.nls.utils.GlobalBehavior settings)
Method printFullCandidate

Parameters:
aPhrase -
settings -

toMetaMapString

public java.lang.String toMetaMapString()
Method toMetaMapString

Returns:
String

toPipedString

public java.lang.String toPipedString()
Method toPipedString

Returns:
String

getUMLSStringPointer

public UMLS_StringPointer getUMLSStringPointer()
Method getUMLSStringPointer retrieves the candidate's reference to the UMLSStringPointer

Returns:
UMLS_StringPointer

getSources

public UMLSSourceInfo[] getSources()
Method getSources retrieves valid sources for this sui|cui candidate

Returns:
UMLSSourceInfo[]

getAllSources

public UMLSSourceInfo[] getAllSources()
Method getAllSources retrieves all the sources for this cui of the candidate

Returns:
UMLSSourceInfo[]

getAllSourcesList

public java.lang.String getAllSourcesList()
Method getAllSourcesList retrieves all (unique) sources for this cui candidate in a comma separated list of source abbreviations

Returns:
String

getRestrictedSourcesList

public java.lang.String getRestrictedSourcesList(gov.nih.nlm.nls.utils.GlobalBehavior pSettings)
Method getRestrictedSourcesList retrieves those (unique) sources for this cui candidate that are from the restrict to source list. Note that this candidate concept could also have come from sources that are not listed here, but that if they appear here, they were found within the noted sources.

Parameters:
pSettings -
Returns:
String

getSourcesAndTermTypes

public java.lang.String getSourcesAndTermTypes()
Method getSourcesAndTermTypes retrieves the (source|term type, ) pairs for this cui candidate in a comma separated list of term types.

Returns:
String

getValidSourcesList

public java.lang.String getValidSourcesList()
Method getValidSourcesList retrieves valid (unique) sources for this cui|sui candidate in a comma separated list of source abbreviations

Returns:
String

getSuis

public java.lang.String getSuis()
Method getSuis retrieves suis, and if the sources have been retrieved, the sources of the suis



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.