public class TermOccurrence extends java.lang.Object implements java.lang.Comparable<TermOccurrence>
Constructor and Description |
---|
TermOccurrence(Term term,
java.lang.String coveredText,
Document sourceFile,
int begin,
int end) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(TermOccurrence o) |
java.util.Iterator<TermOccurrence> |
contextIterator(OccurrenceType coTermsType,
int contextSize) |
boolean |
equals(java.lang.Object obj) |
int |
getBegin() |
java.lang.String |
getCoveredText() |
int |
getEnd() |
java.lang.String |
getForm() |
Document |
getSourceDocument() |
Term |
getTerm() |
java.lang.String |
getTextualContext(int contextSize) |
int |
hashCode() |
boolean |
isPrimaryOccurrence()
True if this occurrence is marked as primary, i.e. if
it can be considered as a true occurrence of term in a
non-overlapping sequence of term occurrences
|
boolean |
overlaps(TermOccurrence theOcc)
True if both source documents are the same and if the
offsets in the document overlaps.
|
void |
setPrimaryOccurrence(boolean primaryOccurrence) |
void |
setTerm(Term term2) |
java.lang.String |
toString() |
public Term getTerm()
public java.lang.String getCoveredText()
public Document getSourceDocument()
public int getBegin()
public int getEnd()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int compareTo(TermOccurrence o)
compareTo
in interface java.lang.Comparable<TermOccurrence>
public java.lang.String getForm()
public java.lang.String getTextualContext(int contextSize) throws java.io.IOException
contextSize
- The number of characters before and after the occurrence.java.io.IOException
public java.util.Iterator<TermOccurrence> contextIterator(OccurrenceType coTermsType, int contextSize)
public java.lang.String toString()
toString
in class java.lang.Object
public void setTerm(Term term2)
public boolean isPrimaryOccurrence()
public void setPrimaryOccurrence(boolean primaryOccurrence)
public boolean overlaps(TermOccurrence theOcc)
theOcc
-