net.ontopia.topicmaps.classify
Class TermDatabase

java.lang.Object
  extended by net.ontopia.topicmaps.classify.TermDatabase

public class TermDatabase
extends java.lang.Object

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.


Method Summary
 void dump()
          INTERNAL: Writes the contents of the term database out to System.out for debugging purposes.
 void dump(int firstN)
          INTERNAL: Writes the contents of the term database out to System.out for debugging purposes.
 Term getTerm(java.lang.String stem)
          PUBLIC: Looks up a particular term by its stem.
 int getTermCount()
          PUBLIC: Returns the number of terms in the database.
 java.util.Collection<Term> getTerms()
          PUBLIC: Returns all terms found in the classified content.
 Term[] getTermsByRank()
          PUBLIC: Returns all terms found in the classified content sorted by score.
 Variant getVariant(java.lang.String variant)
          PUBLIC: Looks up a particular variant by its string representation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTerms

public java.util.Collection<Term> getTerms()
PUBLIC: Returns all terms found in the classified content.


getTermsByRank

public Term[] 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 Term getTerm(java.lang.String stem)
PUBLIC: Looks up a particular term by its stem. Returns null if no term is found.


getVariant

public Variant getVariant(java.lang.String variant)
PUBLIC: Looks up a particular variant by its string representation. Returns null if no variant is found.


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


Copyright © 2000-2010 Ontopia.