Class KeepLargestBlockFilter
- java.lang.Object
-
- de.l3s.boilerpipe.filters.heuristics.KeepLargestBlockFilter
-
- All Implemented Interfaces:
BoilerpipeFilter
public final class KeepLargestBlockFilter extends java.lang.Object implements BoilerpipeFilter
Keeps the largestTextBlockonly (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 asDefaultLabels.MIGHT_BE_CONTENT. Note that, by default, only TextBlocks marked as "content" are taken into consideration.
-
-
Field Summary
Fields Modifier and Type Field Description static KeepLargestBlockFilterINSTANCEstatic KeepLargestBlockFilterINSTANCE_EXPAND_TO_SAME_TAGLEVEL
-
Constructor Summary
Constructors Constructor Description KeepLargestBlockFilter(boolean expandToSameLevelText)
-
Method Summary
Modifier and Type Method Description booleanprocess(TextDocument doc)Processes the given documentdoc.
-
-
-
Field Detail
-
INSTANCE
public static final KeepLargestBlockFilter INSTANCE
-
INSTANCE_EXPAND_TO_SAME_TAGLEVEL
public static final KeepLargestBlockFilter INSTANCE_EXPAND_TO_SAME_TAGLEVEL
-
-
Method Detail
-
process
public boolean process(TextDocument doc) throws BoilerpipeProcessingException
Description copied from interface:BoilerpipeFilterProcesses the given documentdoc.- Specified by:
processin interfaceBoilerpipeFilter- Parameters:
doc- TheTextDocumentthat is to be processed.- Returns:
trueif changes have been made to theTextDocument.- Throws:
BoilerpipeProcessingException
-
-