|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.l3s.boilerpipe.document.TextBlock
public class TextBlock
Describes a block of text. A block can be an "atomic" text element (i.e., a sequence of text that is not interrupted by any HTML markup) or a compound of such atomic elements.
Field Summary | |
---|---|
static TextBlock |
EMPTY_END
|
static TextBlock |
EMPTY_START
|
Constructor Summary | |
---|---|
TextBlock(java.lang.String text)
|
|
TextBlock(java.lang.String text,
java.util.BitSet containedTextElements,
int numWords,
int numWordsInAnchorText,
int numWordsInWrappedLines,
int numWrappedLines,
int offsetBlocks)
|
Method Summary | |
---|---|
void |
addLabel(java.lang.String label)
Adds an arbitrary String label to this TextBlock . |
void |
addLabels(java.util.Set<java.lang.String> l)
Adds a set of labels to this TextBlock . |
void |
addLabels(java.lang.String... l)
Adds a set of labels to this TextBlock . |
protected java.lang.Object |
clone()
|
java.util.BitSet |
getContainedTextElements()
Returns the containedTextElements BitSet, or null . |
java.util.Set<java.lang.String> |
getLabels()
Returns the labels associated to this TextBlock, or null if no such labels
exist. |
float |
getLinkDensity()
|
int |
getNumWords()
|
int |
getNumWordsInAnchorText()
|
int |
getOffsetBlocksEnd()
|
int |
getOffsetBlocksStart()
|
int |
getTagLevel()
|
java.lang.String |
getText()
|
float |
getTextDensity()
|
boolean |
hasLabel(java.lang.String label)
Checks whether this TextBlock has the given label. |
boolean |
isContent()
|
void |
mergeNext(TextBlock other)
|
boolean |
removeLabel(java.lang.String label)
|
boolean |
setIsContent(boolean isContent)
|
void |
setTagLevel(int tagLevel)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final TextBlock EMPTY_START
public static final TextBlock EMPTY_END
Constructor Detail |
---|
public TextBlock(java.lang.String text)
public TextBlock(java.lang.String text, java.util.BitSet containedTextElements, int numWords, int numWordsInAnchorText, int numWordsInWrappedLines, int numWrappedLines, int offsetBlocks)
Method Detail |
---|
public boolean isContent()
public boolean setIsContent(boolean isContent)
public java.lang.String getText()
public int getNumWords()
public int getNumWordsInAnchorText()
public float getTextDensity()
public float getLinkDensity()
public void mergeNext(TextBlock other)
public int getOffsetBlocksStart()
public int getOffsetBlocksEnd()
public java.lang.String toString()
toString
in class java.lang.Object
public void addLabel(java.lang.String label)
TextBlock
.
label
- The labelDefaultLabels
public boolean hasLabel(java.lang.String label)
label
- The label
true
if this block is marked by the given label.public boolean removeLabel(java.lang.String label)
public java.util.Set<java.lang.String> getLabels()
null
if no such labels
exist.
NOTE: The returned instance is the one used directly in TextBlock. You have full access
to the data structure. However it is recommended to use the label-specific methods in TextBlock
whenever possible.
null
if no labels was added yet.public void addLabels(java.util.Set<java.lang.String> l)
TextBlock
.
null
-references are silently ignored.
l
- The labels to be added.public void addLabels(java.lang.String... l)
TextBlock
.
null
-references are silently ignored.
l
- The labels to be added.public java.util.BitSet getContainedTextElements()
null
.
protected java.lang.Object clone()
clone
in class java.lang.Object
public int getTagLevel()
public void setTagLevel(int tagLevel)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |