Package net.ontopia.topicmaps.classify
Class TermDatabase
java.lang.Object
net.ontopia.topicmaps.classify.TermDatabase
PUBLIC: A collection of terms representing the result of
classifying a piece of content. The terms have scores indicating
their importance within the content, and variants, indicating
different spellings for the same term within the content.
Use SimpleClassifier to create TermDatabase objects.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected TokencreateDelimiter(String delimiter) protected TermcreateTerm(String stem) protected VariantcreateVariant(String variant) voiddump()INTERNAL: Writes the contents of the term database out to System.out for debugging purposes.voiddump(int firstN) INTERNAL: Writes the contents of the term database out to System.out for debugging purposes.protected doublePUBLIC: Looks up a particular term by its stem.intPUBLIC: Returns the number of terms in the database.getTerms()PUBLIC: Returns all terms found in the classified content.Term[]PUBLIC: Returns all terms found in the classified content sorted by score.getVariant(String variant) PUBLIC: Looks up a particular variant by its string representation.protected voidmergeTerms(Term t1, Term t2)
-
Field Details
-
terms
-
variants
-
delimiter_terms
-
-
Method Details
-
getTerms
PUBLIC: Returns all terms found in the classified content. -
getTermsByRank
PUBLIC: Returns all terms found in the classified content sorted by score. -
getTermCount
public int getTermCount()PUBLIC: Returns the number of terms in the database. -
getTerm
PUBLIC: Looks up a particular term by its stem. Returns null if no term is found. -
getVariant
PUBLIC: Looks up a particular variant by its string representation. Returns null if no variant is found. -
createDelimiter
-
mergeTerms
-
createTerm
-
getMaxScore
protected double getMaxScore() -
createVariant
-
dump
public void dump()INTERNAL: Writes the contents of the term database out to System.out for debugging purposes. -
dump
public void dump(int firstN) INTERNAL: Writes the contents of the term database out to System.out for debugging purposes.- Parameters:
firstN- how many terms to output
-