public class SimpleText extends Text implements TextTerms, AnchorText
Constructor and Description |
---|
SimpleText(java.lang.String id,
java.lang.String title,
java.lang.String body,
java.lang.String[] words)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
SimpleText |
addAnchor(java.lang.String linkLabel)
Add a link label to the anchor text.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAnchor()
Returns the anchor text if any.
|
int |
hashCode() |
int |
maxtf()
Returns the maximum term frequency over all terms in the document.
|
SimpleText |
setAnchor(java.lang.String anchor)
Sets the anchor text.
|
int |
size()
Returns the number of words.
|
int |
tf(java.lang.String term)
Returns the term frequency.
|
java.lang.String |
toString() |
java.lang.Iterable<java.lang.String> |
unique()
Returns the iterator of unique words.
|
java.lang.Iterable<java.lang.String> |
words()
Returns the iterator of the words of the document.
|
public SimpleText(java.lang.String id, java.lang.String title, java.lang.String body, java.lang.String[] words)
id
- the id of document.words
- the word list of document.public int size()
TextTerms
public java.lang.Iterable<java.lang.String> words()
TextTerms
public java.lang.Iterable<java.lang.String> unique()
TextTerms
public int tf(java.lang.String term)
TextTerms
public int maxtf()
TextTerms
public java.lang.String getAnchor()
getAnchor
in interface AnchorText
public SimpleText setAnchor(java.lang.String anchor)
setAnchor
in interface AnchorText
public SimpleText addAnchor(java.lang.String linkLabel)
AnchorText
addAnchor
in interface AnchorText
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object