@Bindable(prefix="StopLabelFilter") public class StopLabelFilter extends SingleLabelFilterBase
Modifier and Type | Field and Description |
---|---|
boolean |
enabled
Remove stop labels.
|
LabelFormatter |
labelFormatter |
ILexicalData |
lexicalData |
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 final LabelFormatter labelFormatter
public ILexicalData lexicalData
public void filter(PreprocessingContext context, boolean[] acceptedStems, boolean[] acceptedPhrases)
ILabelFilter
filter
in interface ILabelFilter
filter
in class SingleLabelFilterBase
context
- 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)
SingleLabelFilterBase
true
if the phrase located at phraseIndex
is to be accepted, false
otherwise.acceptPhrase
in class SingleLabelFilterBase
context
- 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)
SingleLabelFilterBase
true
if the word located at wordIndex
is to
be accepted, false
otherwise.acceptWord
in class SingleLabelFilterBase
context
- 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
.