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()
TextTermspublic java.lang.Iterable<java.lang.String> words()
TextTermspublic java.lang.Iterable<java.lang.String> unique()
TextTermspublic int tf(java.lang.String term)
TextTermspublic int maxtf()
TextTermspublic java.lang.String getAnchor()
getAnchor in interface AnchorTextpublic SimpleText setAnchor(java.lang.String anchor)
setAnchor in interface AnchorTextpublic SimpleText addAnchor(java.lang.String linkLabel)
AnchorTextaddAnchor in interface AnchorTextpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object