C# Class NBoilerpipe.Document.TextBlock

Describes a block of text.
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.
Inheritance: ICloneable
Show file Open project: oganix/NBoilerpipe Class Usage Examples

Public Properties

Property Type Description
EMPTY_END NBoilerpipe.Document.TextBlock
EMPTY_START NBoilerpipe.Document.TextBlock

Public Methods

Method Description
AddLabel ( string label ) : void

Adds an arbitrary String label to this TextBlock .

AddLabels ( ) : void

Adds a set of labels to this TextBlock . null-references are silently ignored.

AddLabels ( ICollection l ) : void

Adds a set of labels to this TextBlock . null-references are silently ignored.

Clone ( ) : Object
GetContainedTextElements ( ) : BitSet

Returns the containedTextElements BitSet, or null.

Returns the containedTextElements BitSet, or null.

GetLabels ( ) : ICollection

Returns the labels associated to this TextBlock, or null if no such labels exist.

Returns the labels associated to this TextBlock, or 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.

GetLinkDensity ( ) : float
GetNumWords ( ) : int
GetNumWordsInAnchorText ( ) : int
GetOffsetBlocksEnd ( ) : int
GetOffsetBlocksStart ( ) : int
GetTagLevel ( ) : int
GetText ( ) : string
GetTextDensity ( ) : float
HasLabel ( string label ) : bool

Checks whether this TextBlock has the given label.

Checks whether this TextBlock has the given label.

IsContent ( ) : bool
MergeNext ( NBoilerpipe other ) : void
RemoveLabel ( string label ) : bool
SetIsContent ( bool isContent ) : bool
SetTagLevel ( int tagLevel ) : void
TextBlock ( string text ) : System
TextBlock ( string text, BitSet containedTextElements, int numWords, int numWordsInAnchorText, int numWordsInWrappedLines, int numWrappedLines, int offsetBlocks ) : System
ToString ( ) : string

Private Methods

Method Description
InitDensities ( ) : void

Method Details

AddLabel() public method

Adds an arbitrary String label to this TextBlock .
public AddLabel ( string label ) : void
label string The label
return void

AddLabels() public method

Adds a set of labels to this TextBlock . null-references are silently ignored.
public AddLabels ( ) : void
return void

AddLabels() public method

Adds a set of labels to this TextBlock . null-references are silently ignored.
public AddLabels ( ICollection l ) : void
l ICollection The labels to be added.
return void

Clone() public method

public Clone ( ) : Object
return Object

GetContainedTextElements() public method

Returns the containedTextElements BitSet, or null.
Returns the containedTextElements BitSet, or null.
public GetContainedTextElements ( ) : BitSet
return Sharpen.BitSet

GetLabels() public method

Returns the labels associated to this TextBlock, or null if no such labels exist.
Returns the labels associated to this TextBlock, or 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.
public GetLabels ( ) : ICollection
return ICollection

GetLinkDensity() public method

public GetLinkDensity ( ) : float
return float

GetNumWords() public method

public GetNumWords ( ) : int
return int

GetNumWordsInAnchorText() public method

public GetNumWordsInAnchorText ( ) : int
return int

GetOffsetBlocksEnd() public method

public GetOffsetBlocksEnd ( ) : int
return int

GetOffsetBlocksStart() public method

public GetOffsetBlocksStart ( ) : int
return int

GetTagLevel() public method

public GetTagLevel ( ) : int
return int

GetText() public method

public GetText ( ) : string
return string

GetTextDensity() public method

public GetTextDensity ( ) : float
return float

HasLabel() public method

Checks whether this TextBlock has the given label.
Checks whether this TextBlock has the given label.
public HasLabel ( string label ) : bool
label string The label
return bool

IsContent() public method

public IsContent ( ) : bool
return bool

MergeNext() public method

public MergeNext ( NBoilerpipe other ) : void
other NBoilerpipe
return void

RemoveLabel() public method

public RemoveLabel ( string label ) : bool
label string
return bool

SetIsContent() public method

public SetIsContent ( bool isContent ) : bool
isContent bool
return bool

SetTagLevel() public method

public SetTagLevel ( int tagLevel ) : void
tagLevel int
return void

TextBlock() public method

public TextBlock ( string text ) : System
text string
return System

TextBlock() public method

public TextBlock ( string text, BitSet containedTextElements, int numWords, int numWordsInAnchorText, int numWordsInWrappedLines, int numWrappedLines, int offsetBlocks ) : System
text string
containedTextElements Sharpen.BitSet
numWords int
numWordsInAnchorText int
numWordsInWrappedLines int
numWrappedLines int
offsetBlocks int
return System

ToString() public method

public ToString ( ) : string
return string

Property Details

EMPTY_END public static property

public static NBoilerpipe.Document.TextBlock EMPTY_END
return NBoilerpipe.Document.TextBlock

EMPTY_START public static property

public static NBoilerpipe.Document.TextBlock EMPTY_START
return NBoilerpipe.Document.TextBlock