public class TermDatabase extends Object
Use SimpleClassifier to create TermDatabase objects.
Modifier and Type | Field and Description |
---|---|
protected Map<String,Token> |
delimiter_terms |
protected Map<String,Term> |
terms |
protected Map<String,Variant> |
variants |
Modifier and Type | Method and Description |
---|---|
protected Token |
createDelimiter(String delimiter) |
protected Term |
createTerm(String stem) |
protected Variant |
createVariant(String variant) |
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.
|
protected double |
getMaxScore() |
Term |
getTerm(String stem)
PUBLIC: Looks up a particular term by its stem.
|
int |
getTermCount()
PUBLIC: Returns the number of terms in the database.
|
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(String variant)
PUBLIC: Looks up a particular variant by its string representation.
|
protected void |
mergeTerms(Term t1,
Term t2) |
public Collection<Term> getTerms()
public Term[] getTermsByRank()
public int getTermCount()
public Term getTerm(String stem)
public Variant getVariant(String variant)
protected double getMaxScore()
public void dump()
public void dump(int firstN)
firstN
- how many terms to output