public final class KeepLargestBlockFilter extends java.lang.Object implements BoilerpipeFilter
TextBlock
only (by the number of words). In case of
more than one block with the same number of words, the first block is chosen.
All discarded blocks are marked "not content" and flagged as
DefaultLabels.MIGHT_BE_CONTENT
.
Note that, by default, only TextBlocks marked as "content" are taken into consideration.Modifier and Type | Field and Description |
---|---|
static KeepLargestBlockFilter |
INSTANCE |
static KeepLargestBlockFilter |
INSTANCE_EXPAND_TO_SAME_TAGLEVEL |
Constructor and Description |
---|
KeepLargestBlockFilter(boolean expandToSameLevelText) |
Modifier and Type | Method and Description |
---|---|
boolean |
process(TextDocument doc)
Processes the given document
doc . |
public static final KeepLargestBlockFilter INSTANCE
public static final KeepLargestBlockFilter INSTANCE_EXPAND_TO_SAME_TAGLEVEL
public KeepLargestBlockFilter(boolean expandToSameLevelText)
public boolean process(TextDocument doc) throws BoilerpipeProcessingException
BoilerpipeFilter
doc
.process
in interface BoilerpipeFilter
doc
- The TextDocument
that is to be processed.true
if changes have been made to the
TextDocument
.BoilerpipeProcessingException