Class StopLabelFilter
- java.lang.Object
-
- org.carrot2.attrs.AttrComposite
-
- org.carrot2.text.preprocessing.filter.SingleLabelFilterBase
-
- org.carrot2.text.preprocessing.filter.StopLabelFilter
-
- All Implemented Interfaces:
AcceptingVisitor
,LabelFilter
public class StopLabelFilter extends SingleLabelFilterBase
Accepts labels that are not declared as stop labels in thestoplabels.<lang>
files.
-
-
Field Summary
-
Fields inherited from class org.carrot2.attrs.AttrComposite
attributes
-
-
Constructor Summary
Constructors Constructor Description StopLabelFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptPhrase(PreprocessingContext context, int phraseIndex)
Should returntrue
if the phrase located atphraseIndex
is to be accepted,false
otherwise.boolean
acceptWord(PreprocessingContext context, int wordIndex)
Should returntrue
if the word located atwordIndex
is to be accepted,false
otherwise.void
filter(PreprocessingContext context, boolean[] acceptedStems, boolean[] acceptedPhrases)
Called to perform label filtering.-
Methods inherited from class org.carrot2.attrs.AttrComposite
accept
-
-
-
-
Method Detail
-
filter
public void filter(PreprocessingContext context, boolean[] acceptedStems, boolean[] acceptedPhrases)
Description copied from interface:LabelFilter
Called to perform label filtering.- Specified by:
filter
in interfaceLabelFilter
- Overrides:
filter
in classSingleLabelFilterBase
- Parameters:
context
- contains words and phrases to be filteredacceptedStems
- the filter should set tofalse
those elements that correspond to the stems to be filtered outacceptedPhrases
- the filter should set tofalse
those elements that correspond to the phrases to be filtered out
-
acceptPhrase
public boolean acceptPhrase(PreprocessingContext context, int phraseIndex)
Description copied from class:SingleLabelFilterBase
Should returntrue
if the phrase located atphraseIndex
is to be accepted,false
otherwise.- Specified by:
acceptPhrase
in classSingleLabelFilterBase
- Parameters:
context
- provides access to all information about the phrasephraseIndex
- index of the phrase for which decision is to be made
-
acceptWord
public boolean acceptWord(PreprocessingContext context, int wordIndex)
Description copied from class:SingleLabelFilterBase
Should returntrue
if the word located atwordIndex
is to be accepted,false
otherwise.- Specified by:
acceptWord
in classSingleLabelFilterBase
- Parameters:
context
- provides access to all information about the wordwordIndex
- index of the word for which decision is to be made
-
-