Package net.ontopia.topicmaps.classify
Class Term
- java.lang.Object
-
- net.ontopia.topicmaps.classify.Term
-
public class Term extends Object
PUBLIC: Represents a concept which occurs in the classified content. A term can have many variants, all of which can be found from this object. It also has a score, indicating the importance of the term within the content.
-
-
Field Summary
Fields Modifier and Type Field Description protected doublescoreprotected static Comparator<Term>SCORE_COMPARATORprotected Stringstemprotected inttotalOccurrencesprotected gnu.trove.map.hash.TObjectIntHashMap<Variant>variants
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddScore(double ascore, String reason)protected voidaddVariant(Variant variant)protected voidaddVariant(Variant variant, int occurrences)protected voiddivideScore(double factor, String reason)intgetOccurrences()PUBLIC: Returns the number of times the term occurred within the classified content.protected intgetOccurrences(Variant variant)StringgetPreferredName()PUBLIC: Returns the preferred variant of the term.doublegetScore()PUBLIC: Returns the term's score, a number in the range 0-1, indicating its importance within the content.protected doublegetScore(Variant v)StringgetStem()PUBLIC: Returns the stem common to all variants of the term.Variant[]getVariants()PUBLIC: Returns all variant spellings of this term within the content.Variant[]getVariantsByRank()PUBLIC: Returns all variant spellings of this term within the content, with the most important first.protected voidmerge(Term other)protected voidmultiplyScore(double factor, String reason)protected voidsetScore(double score, String reason)StringtoString()
-
-
-
Field Detail
-
stem
protected String stem
-
score
protected double score
-
totalOccurrences
protected int totalOccurrences
-
variants
protected gnu.trove.map.hash.TObjectIntHashMap<Variant> variants
-
SCORE_COMPARATOR
protected static Comparator<Term> SCORE_COMPARATOR
-
-
Method Detail
-
getStem
public String getStem()
PUBLIC: Returns the stem common to all variants of the term. Often, the stem does not actually occur in the content.
-
getScore
public double getScore()
PUBLIC: Returns the term's score, a number in the range 0-1, indicating its importance within the content.
-
getVariants
public Variant[] getVariants()
PUBLIC: Returns all variant spellings of this term within the content.
-
getVariantsByRank
public Variant[] getVariantsByRank()
PUBLIC: Returns all variant spellings of this term within the content, with the most important first.
-
getOccurrences
public int getOccurrences()
PUBLIC: Returns the number of times the term occurred within the classified content.
-
getPreferredName
public String getPreferredName()
PUBLIC: Returns the preferred variant of the term. This is a form of the term which actually occurred in the classified content.
-
getScore
protected double getScore(Variant v)
-
getOccurrences
protected int getOccurrences(Variant variant)
-
setScore
protected void setScore(double score, String reason)
-
addScore
protected void addScore(double ascore, String reason)
-
multiplyScore
protected void multiplyScore(double factor, String reason)
-
divideScore
protected void divideScore(double factor, String reason)
-
addVariant
protected void addVariant(Variant variant)
-
addVariant
protected void addVariant(Variant variant, int occurrences)
-
merge
protected void merge(Term other)
-
-