|
Carrot2 v3.6.0-SNAPSHOT
API Documentation |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.carrot2.text.preprocessing.filter.SingleLabelFilterBase
org.carrot2.text.preprocessing.filter.StopLabelFilter
public class StopLabelFilter
Accepts labels that are not declared as stop labels in the stoplabels.<lang> files.
| Field Summary | |
|---|---|
boolean |
enabled
Remove stop labels. |
| Constructor Summary | |
|---|---|
StopLabelFilter()
|
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public boolean enabled
| Constructor Detail |
|---|
public StopLabelFilter()
| Method Detail |
|---|
public void filter(PreprocessingContext context,
boolean[] acceptedStems,
boolean[] acceptedPhrases)
ILabelFilter
filter 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 out
public 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 made
public 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.
|
Please refer to project documentation at
http://project.carrot2.org |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||