org.carrot2.text.preprocessing.filter
Class GenitiveLabelFilter

java.lang.Object
  extended by org.carrot2.text.preprocessing.filter.SingleLabelFilterBase
      extended by org.carrot2.text.preprocessing.filter.GenitiveLabelFilter
All Implemented Interfaces:
ILabelFilter

public class GenitiveLabelFilter
extends SingleLabelFilterBase

Accepts labels that do not end in words in the Saxon Genitive form (e.g. "Threatening the Country's").


Field Summary
 boolean enabled
          Remove labels ending in genitive form.
 
Constructor Summary
GenitiveLabelFilter()
           
 
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.
 boolean isEnabled()
           
 
Methods inherited from class org.carrot2.text.preprocessing.filter.SingleLabelFilterBase
filter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enabled

public boolean enabled
Remove labels ending in genitive form. Removes labels that do end in words in the Saxon Genitive form (e.g. "Threatening the Country's").

Attribute label:
Remove labels ending in genitive form
Attribute level:
Basic
Attribute group:
Label filtering
Constructor Detail

GenitiveLabelFilter

public GenitiveLabelFilter()
Method Detail

acceptPhrase

public boolean acceptPhrase(PreprocessingContext context,
                            int phraseIndex)
Description copied from class: SingleLabelFilterBase
Should return true if the phrase located at phraseIndex is to be accepted, false otherwise.

Specified by:
acceptPhrase in class SingleLabelFilterBase
Parameters:
context - provides access to all information about the phrase
phraseIndex - 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 return true if the word located at wordIndex is to be accepted, false otherwise.

Specified by:
acceptWord in class SingleLabelFilterBase
Parameters:
context - provides access to all information about the word
wordIndex - index of the word for which decision is to be made

isEnabled

public boolean isEnabled()
Returns:
true if the filter is to be applied, false if the filter should be omitted by the LabelFilterProcessor.


Copyright (c) Dawid Weiss, Stanislaw Osinski