|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.nih.nlm.nls.nlp.textfeatures.MmObject
gov.nih.nlm.nls.nlp.textfeatures.Variant
public class Variant
Variant Fri Jun 02 17:46:46 EDT 2000, divita Initial Version
| Field Summary | |
|---|---|
static char |
ACRONYM
|
static int |
ACRONYM_COST
|
static char |
ACRONYM_EXPANSION
|
static int |
ACRONYM_EXPANSION_COST
|
static char |
DERIVATION
|
static int |
DERIVATION_COST
|
static char |
INFLECTION
|
static int |
INFLECTION_COST
|
static char |
NO_OPERATION
|
static int |
NO_OPERATION_COST
|
static char |
SPELLING_VARIANT
|
static int |
SPELLING_VARIANT_COST
|
static char |
SYNONYM
|
static int |
SYNONYM_COST
|
| Fields inherited from class gov.nih.nlm.nls.nlp.textfeatures.MmObject |
|---|
serialVersionUID |
| Constructor Summary | |
|---|---|
Variant(java.lang.String pRow)
This is a constructor for Variant used to create the fullVars table from MetaMap's vars, varsan, varsanu, and varsu table. |
|
Variant(java.lang.String pVariant,
int pCat,
int pDistance,
java.lang.String pHistory,
Span pSpan,
Span pPhraseCharSpan,
Span pPhraseWordSpan,
int pVariantId)
This is a constructor for Variant |
|
Variant(java.lang.String pVariant,
int pCat,
int pInfl,
java.lang.String pRuleOrFact,
java.lang.String pHistory,
Span pSpan,
int pVariantId)
This is a constructor for Variant |
|
Variant(java.lang.String pOrigTerm,
int pOrigCat,
java.lang.String pVariant,
int pCat,
int pInfl,
java.lang.String pRuleOrFact,
java.lang.String pHistory,
int pDistance,
int pFoundInFullTable,
int pFoundInNounAdjDerivationFilteredTable,
int pFoundInNounAdjDerivationAndUniqAcronymFilteredTable,
int pFoundInUniqAcronymsFilteredTable)
This is a constructor for Variant used for variant generation. |
|
| Method Summary | |
|---|---|
void |
addCategory(int pCategory)
Method addCategory |
boolean |
containsNoAcronymsOrAbbreviations()
Method containsNoAcronymsOrAbbreviations returns true if this variant is acronym and abbreviation free. |
boolean |
containsNoDerivations()
Method containsNoDerivations returns true if this variant is derivation free. |
java.lang.String |
display(gov.nih.nlm.nls.utils.GlobalBehavior settings)
Method display returns a string of the variant at the level of detail set by the global behaviors. |
boolean |
equals(java.lang.Object pVariant)
Method equals |
int |
foundInFullTable()
Method foundInFullTable |
int |
foundInNounAdjDerivationAndUniqAcronymFilteredTable()
Method foundInNounAdjDerivationAndUniqAcronymFilteredTable returns 1 if this variant is found in the filtered variants table that filters out all those variants that have derivations that are non noun/adjective pairs and that are unique acronyms or acronym expansions. |
int |
foundInNounAdjDerivationFilteredTable()
Method foundInNounAdjDerivationFilteredTable returns 1 if this variant is found in the filtered variants table that filters out all those variants that have derivations that are non noun/adjective pairs. |
int |
foundInUniqAcronymsFilteredTable()
Method foundInUniqAcronymsFilteredTable returns 1 if this variant is found in the filtered variants table that filters out all those variants that have non-unique acronyms or acronym expansions |
static Variant |
fromBytes(byte[] pBytes)
Method fromBytes ---0----+------1----+---2----+---3---+--4--+-5----+--6--+---7--+--8--+--9--+---10--+---11---+--12-----+ int | int | int | int | int| int | int | int |int | int |n bytes| m bytes| p bytes | term cat|variant cat|distance|FullVar|VarAN|VarANU|VarU | #term|#var |#hist|term | variant| history | --------+-----------+--------+-------+-----+------+-----+------+-----+-----+-------+--------+---------+ |
static Variant |
fromTableRow(java.lang.String pRow)
Method fromTableRow creates a variant from a row from the fullVars table. |
int |
getCategories()
Method getCategories returns the category(s) of this variant |
int |
getDistance()
Method getDistance |
java.lang.String |
getHistory()
Method getHistory |
int |
getInflections()
Method getInflections returns the inflection(s) of this variant. |
java.lang.String |
getNormalizedTerm()
Method getNormalizedTerm retrieves the Variant term, lowercased, devoid of punctuation - this is supposed to match the normalization that was done to create the normalized string, string sui table. |
int |
getOrigCat()
Method getOrigCat |
java.lang.String |
getOrigTerm()
Method getOrigTerm |
LexicalElement |
getParent()
Method getParent returns the LexicalElement that this variant came from. |
Span |
getPhraseCharSpan()
Method getPhraseCharSpan |
int |
getPhrasePosition()
getPhrasePosition gets the lexical element position of this variant within the phrase. |
int |
getPhraseTokenPosition()
Method getPhraseTokenPosition |
Span |
getPhraseWordSpan()
Method getPhraseWordSpan |
java.lang.String |
getTerm()
Method getTerm retrieves the Variant term |
java.util.Vector |
getTokens()
Method getTokens computes the tokens (if it has not already done so) of this term, and returns them. |
static void |
main(java.lang.String[] argv)
This is a test main, whose purpose is to test the functionality of each method developed for this class. |
void |
setDistance(int pDistance)
Method setDistance |
void |
setFoundInFullTable()
Method setFoundInFullTable |
void |
setFoundInNounAdjDerivationAndUniqAcronymFilteredTable()
Method setFoundInNounAdjDerivationAndUniqAcronymFilteredTable |
void |
setFoundInNounAdjDerivationFilteredTable()
Method setFoundInNounAdjDerivationFilteredTable |
void |
setFoundInUniqAcronymsFilteredTable()
Method setFoundInUniqAcronymsFilteredTable |
void |
setHistory(java.lang.String pHistory)
Method setHistory |
void |
setNormalizedTerm(java.lang.String pTerm)
Method setNormalizedTerm sets the Variant term, lowercased, devoid of punctuation - this is supposed to match the normalization that was done to create the normalized string, string sui table. |
void |
setParent(LexicalElement pParent)
Method setParent preserves the link from the original LexicalElement to this variant |
void |
setPhraseCharSpan(Span pSpan)
Method setPhraseCharSpan |
void |
setPhrasePosition(int pPos)
setPhrasePosition records the position of this variant (as a lexical Element) within the phrase. |
void |
setPhraseTokenPosition(int pPos)
Method setPhraseTokenPosition. |
void |
setPhraseWordSpan(Span pSpan)
Method setPhraseWordSpan |
void |
setSpan(Span pSpan)
Method setSpan |
void |
setTokens(java.util.Vector pTokens)
Method setTokens adds the set of tokens that make up this variant |
byte[] |
toBytes()
Method toBytes ---0----+------1----+---2----+---3---+--4--+-5----+--6--+---7--+--8--+--9--+---10--+---11---+--12-----+ int | int | int | int | int| int | int | int |int | int |n bytes| m bytes| p bytes | term cat|variant cat|distance|FullVar|VarAN|VarANU|VarU | #term|#var |#hist|term | variant| history | --------+-----------+--------+-------+-----+------+-----+------+-----+-----+-------+--------+---------+ |
java.lang.String |
toFormatedString()
Method toFormatedString is the method that prints out a variant in the format used to be absorbed into the db's variant table. |
java.lang.String |
toMetaMapVarsRow()
Method toMetaMapVarsRow is the method that prints out a variant in one of MetaMap's Vars tables. |
java.lang.String |
toPipedString()
Method toPipedString returns a pipe delimited fielded represtentation of some of the attributes of this variant. |
java.lang.String |
toString()
Method toString |
| 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NO_OPERATION_COST
public static final int SPELLING_VARIANT_COST
public static final int INFLECTION_COST
public static final int SYNONYM_COST
public static final int ACRONYM_COST
public static final int ACRONYM_EXPANSION_COST
public static final int DERIVATION_COST
public static final char NO_OPERATION
public static final char SPELLING_VARIANT
public static final char INFLECTION
public static final char SYNONYM
public static final char ACRONYM
public static final char ACRONYM_EXPANSION
public static final char DERIVATION
| Constructor Detail |
|---|
public Variant(java.lang.String pVariant,
int pCat,
int pInfl,
java.lang.String pRuleOrFact,
java.lang.String pHistory,
Span pSpan,
int pVariantId)
pVariant - The variant of the lexicalElementpCat - The category of this variant.pInfl - The category of this variant.pRuleOrFact - String indicating whether this variant came
from a rule or fact ie.-> RULE|FACTpHistory - The history of how this variant came to be from
the original term. The history will be composed
of the following:
| n | None |
| y | Synonym |
| d | Derivation |
| A | Acronym |
| a | Acronym expansion |
| s | Spelling variant |
pSpan - The span of the original term.pVariantId - The id of the variant of this lexical element
public Variant(java.lang.String pVariant,
int pCat,
int pDistance,
java.lang.String pHistory,
Span pSpan,
Span pPhraseCharSpan,
Span pPhraseWordSpan,
int pVariantId)
pVariant - The variant of the lexicalElementpCat - The category of this variant.pDistance - Precomputed distance from the historypHistory - The history of how this variant came to be from
the original term. The history will be composed
of the following:
| n | None |
| y | Synonym |
| d | Derivation |
| A | Acronym |
| a | Acronym expansion |
| s | Spelling variant |
pSpan - The span of the original term.pPhraseCharSpan - pPhraseWordSpan - pVariantId - The id of the variant of this lexical element
public Variant(java.lang.String pOrigTerm,
int pOrigCat,
java.lang.String pVariant,
int pCat,
int pInfl,
java.lang.String pRuleOrFact,
java.lang.String pHistory,
int pDistance,
int pFoundInFullTable,
int pFoundInNounAdjDerivationFilteredTable,
int pFoundInNounAdjDerivationAndUniqAcronymFilteredTable,
int pFoundInUniqAcronymsFilteredTable)
pOrigTerm - The original term.pOrigCat - The category of the original term.pVariant - The variant of the lexicalElementpCat - The category of this variant.pInfl - The category of this variant.pRuleOrFact - String indicating whether this variant came
from a rule or fact ie.-> RULE|FACTpHistory - The history of how this variant came to be from
the original term. The history will be composed
of the following:
| n | None |
| y | Synonym |
| d | Derivation |
| A | Acronym |
| a | Acronym expansion |
| s | Spelling variant |
pDistance - Precomputed distance from the historypFoundInFullTable - 1 if in the full TablepFoundInNounAdjDerivationFilteredTable - 1 if in the table that filters
out non noun/adj deriv. variants.
0 otherwise.pFoundInNounAdjDerivationAndUniqAcronymFilteredTable - 1 if in the table that filters
out non noun/adj deriv. and
non unique acronym/acronym
expansion variants.
0 otherwise.pFoundInUniqAcronymsFilteredTable - 1 if in the table that filters
out non unique acronym/acronym
expansion variants.
0 otherwise.public Variant(java.lang.String pRow)
pRow - of the format: key|input cat|variant|output cat|history|[]| Method Detail |
|---|
public void setTokens(java.util.Vector pTokens)
pTokens - a Vector of Tokenpublic void setParent(LexicalElement pParent)
pParent - public void addCategory(int pCategory)
pCategory - public void setHistory(java.lang.String pHistory)
pHistory - public java.lang.String getHistory()
public void setDistance(int pDistance)
pDistance - public void setSpan(Span pSpan)
pSpan - public void setPhraseCharSpan(Span pSpan)
pSpan - public void setPhraseWordSpan(Span pSpan)
pSpan - public int getDistance()
public java.lang.String getTerm()
public java.lang.String getNormalizedTerm()
public void setNormalizedTerm(java.lang.String pTerm)
pTerm - public int getCategories()
public int getInflections()
public java.util.Vector getTokens()
public java.lang.String display(gov.nih.nlm.nls.utils.GlobalBehavior settings)
settings -
public java.lang.String toPipedString()
public java.lang.String toString()
toString in class MmObjectpublic void setPhrasePosition(int pPos)
pPos - Position of the lexical Element in the phrase.public int getPhrasePosition()
public void setPhraseTokenPosition(int pPos)
pPos - public int getPhraseTokenPosition()
public Span getPhraseWordSpan()
public Span getPhraseCharSpan()
public int foundInFullTable()
public void setFoundInFullTable()
public int foundInNounAdjDerivationFilteredTable()
public void setFoundInNounAdjDerivationFilteredTable()
public int foundInNounAdjDerivationAndUniqAcronymFilteredTable()
public void setFoundInNounAdjDerivationAndUniqAcronymFilteredTable()
public boolean containsNoDerivations()
public boolean containsNoAcronymsOrAbbreviations()
public int foundInUniqAcronymsFilteredTable()
public void setFoundInUniqAcronymsFilteredTable()
public java.lang.String getOrigTerm()
public LexicalElement getParent()
public int getOrigCat()
public java.lang.String toFormatedString()
public java.lang.String toMetaMapVarsRow()
public boolean equals(java.lang.Object pVariant)
equals in class java.lang.ObjectpVariant -
public static Variant fromTableRow(java.lang.String pRow)
throws java.lang.Exception
pRow -
java.lang.Exception
public byte[] toBytes()
throws java.lang.Exception
java.lang.Exception
public static Variant fromBytes(byte[] pBytes)
throws java.lang.Exception
pBytes -
java.lang.Exceptionpublic static final void main(java.lang.String[] argv)
argv - The command line input, tokenized
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||