|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tml.corpus.Term
public class Term
The Term
class represents a unique word within a Corpus
. It
is stored by the Corpus
' Dictionary
and it contain links to
all the TextPassage
s that contain the Term
.
The class also contains some statistics like the total number of times it
appears in a Corpus
.
The following code shows how to use the Term
s from a
TextDocument
... TextDocument document = .....; List<Term> terms = document.getSentenceCorpus().getDictionary().getTerms(); for(Term term : terms) { System.out.println("Term:" + term.getTerm()); System.out.println("DF:" + term.getDocumentFrequency()); System.out.println("TF:" + term.getTermFrequency()); }
Constructor Summary | |
---|---|
Term(java.lang.String term,
int index)
Creates a new Term , with an index defined by an external source
(usually a Dictionary . |
Method Summary | |
---|---|
void |
addTermAppearance(TextPassage textPassage,
double termFrequency)
Adds a new TextPassage to the Term |
int |
getDocumentFrequency()
|
int |
getIndex()
|
java.lang.String |
getTerm()
|
int |
getTermGlobalFrequency()
|
double |
getTermGlobalFrequencyMean()
|
java.util.List<TextPassage> |
getTextPassages()
|
boolean |
isConcept()
|
void |
setConcept(boolean isConcept)
|
void |
setIndex(int index)
Changes the value of the index for the Term within a
Corpus |
java.lang.String |
toString()
The default string for a Term is it's own word |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Term(java.lang.String term, int index)
Term
, with an index defined by an external source
(usually a Dictionary
.
term
- index
- Method Detail |
---|
public void setConcept(boolean isConcept)
isConcept
- if the Term
is a Conceptpublic void addTermAppearance(TextPassage textPassage, double termFrequency)
TextPassage
to the Term
textPassage
- termFrequency
- public int getDocumentFrequency()
public int getIndex()
Term
within its Dictionary
public java.lang.String getTerm()
Term
public int getTermGlobalFrequency()
Term
, i.e. how many times the
word appears in the Corpus
.public double getTermGlobalFrequencyMean()
Term
along the
TextPassage
s of a Corpus
.public java.util.List<TextPassage> getTextPassages()
TextPassage
s to which the Term
belongspublic void setIndex(int index)
Term
within a
Corpus
index
- public java.lang.String toString()
toString
in class java.lang.Object
public boolean isConcept()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |