@Bindable(prefix="StopLabelFilter") public class StopLabelFilter extends SingleLabelFilterBase
| Modifier and Type | Field and Description |
|---|---|
boolean |
enabled
Remove stop labels.
|
| Constructor and Description |
|---|
StopLabelFilter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptPhrase(PreprocessingContext context,
int phraseIndex)
Should return
true if the phrase located at phraseIndex
is to be accepted, false otherwise. |
boolean |
acceptWord(PreprocessingContext context,
int wordIndex)
Should return
true if the word located at wordIndex is to
be accepted, false otherwise. |
void |
filter(PreprocessingContext context,
boolean[] acceptedStems,
boolean[] acceptedPhrases)
Called to perform label filtering.
|
boolean |
isEnabled() |
@Input @Processing @Attribute @Label(value="Remove stop labels") @Level(value=BASIC) @Group(value="Labels") public boolean enabled
public void filter(PreprocessingContext context, boolean[] acceptedStems, boolean[] acceptedPhrases)
ILabelFilterfilter in interface ILabelFilterfilter in class SingleLabelFilterBasecontext - contains words and phrases to be filteredacceptedStems - the filter should set to false those elements
that correspond to the stems to be filtered outacceptedPhrases - the filter should set to false those elements
that correspond to the phrases to be filtered outpublic boolean acceptPhrase(PreprocessingContext context, int phraseIndex)
SingleLabelFilterBasetrue if the phrase located at phraseIndex
is to be accepted, false otherwise.acceptPhrase in class SingleLabelFilterBasecontext - provides access to all information about the phrasephraseIndex - index of the phrase for which decision is to be madepublic boolean acceptWord(PreprocessingContext context, int wordIndex)
SingleLabelFilterBasetrue if the word located at wordIndex is to
be accepted, false otherwise.acceptWord in class SingleLabelFilterBasecontext - provides access to all information about the wordwordIndex - index of the word for which decision is to be madepublic boolean isEnabled()
true if the filter is to be applied, false if the
filter should be omitted by the LabelFilterProcessor.