|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttml.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 TextPassages 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 Terms 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 Concept
public void addTermAppearance(TextPassage textPassage,
double termFrequency)
TextPassage to the Term
textPassage - termFrequency - public int getDocumentFrequency()
public int getIndex()
Term within its Dictionarypublic java.lang.String getTerm()
Termpublic int getTermGlobalFrequency()
Term, i.e. how many times the
word appears in the Corpus.public double getTermGlobalFrequencyMean()
Term along the
TextPassages of a Corpus.public java.util.List<TextPassage> getTextPassages()
TextPassages to which the Term
belongspublic void setIndex(int index)
Term within a
Corpus
index - public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isConcept()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||