|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tml.corpus.TextPassage
public class TextPassage
This class represents a text passage, that is part of a Corpus
. It
can be a sentence, paragraph, a complete document or any other piece of text
of any length.
Nested Class Summary | |
---|---|
class |
TextPassage.TextPassageStats
This class represents the statistics for a TextPassage . |
Constructor Summary | |
---|---|
TextPassage(int id,
Corpus corpus,
java.lang.String content,
java.lang.String title,
java.lang.String url,
java.lang.String type,
java.lang.String externalId)
Creates a new instance of a TextPassage . |
Method Summary | |
---|---|
void |
addTerm(Term term,
int frequency)
Adds a Term to the passage, it adds a number to the statistics
but it doesn't calculate the final values |
java.util.Hashtable<java.lang.String,java.lang.String> |
getAnnotations()
|
java.lang.String |
getContent()
|
Corpus |
getCorpus()
|
java.lang.String |
getExternalId()
|
int |
getId()
|
Stats |
getStats()
|
double[] |
getTermFreqs()
|
java.util.Collection<Term> |
getTerms()
|
int[] |
getTermsCorpusIndices()
|
java.lang.String |
getTitle()
|
java.lang.String |
getType()
|
java.lang.String |
getUrl()
|
boolean |
isEmpty()
|
void |
removeTerm(Term term)
Removes a Term from the passage |
java.lang.String |
toString()
Basic output of a text passage |
void |
updateTermIndex(Term term,
int oldIndex,
int newIndex)
Updates the index of a Term in the passage |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TextPassage(int id, Corpus corpus, java.lang.String content, java.lang.String title, java.lang.String url, java.lang.String type, java.lang.String externalId)
TextPassage
.
id
- the id of the passagetitle
- the title for the passagecorpus
- the Corpus
to which the passage belongscontent
- the content of the passageurl
- the url for the passagetype
- the type of the passage (document, paragraph or sentence)externalId
- Lucene id of the passageMethod Detail |
---|
public java.lang.String getExternalId()
public java.util.Hashtable<java.lang.String,java.lang.String> getAnnotations()
public void addTerm(Term term, int frequency)
Term
to the passage, it adds a number to the statistics
but it doesn't calculate the final values
term
- frequency
- public java.lang.String getContent()
public Corpus getCorpus()
Corpus
to which the passage belongspublic int getId()
public Stats getStats()
public double[] getTermFreqs()
public java.util.Collection<Term> getTerms()
Term
s in the passagepublic int[] getTermsCorpusIndices()
public java.lang.String getTitle()
public java.lang.String getType()
public java.lang.String getUrl()
public boolean isEmpty()
TextPassage
contains any Term
public void removeTerm(Term term)
Term
from the passage
term
- public java.lang.String toString()
toString
in class java.lang.Object
public void updateTermIndex(Term term, int oldIndex, int newIndex)
Term
in the passage
term
- the Term
which index will be updatedoldIndex
- the old indexnewIndex
- the new index
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |