Package weka.core.tokenizers.cleaners
Class AbstractTokenCleaner
- java.lang.Object
-
- weka.core.tokenizers.cleaners.AbstractTokenCleaner
-
- All Implemented Interfaces:
Serializable,weka.core.OptionHandler,TokenCleaner
- Direct Known Subclasses:
MultiCleaner,NormalizeDuplicateChars,PassThrough,RemoveNonWordCharTokens
public abstract class AbstractTokenCleaner extends Object implements TokenCleaner
Ancestor for cleaning tokens.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractTokenCleaner()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Stringclean(String token)Determines whether a token is clean or not.String[]getOptions()Gets the current option settings for the OptionHandler.abstract StringglobalInfo()Returns a string describing the cleaner.Enumeration<weka.core.Option>listOptions()Returns an enumeration of all the available options..protected voidreset()Resets the cleaner.voidsetOptions(String[] options)Sets the OptionHandler's options using the given list.
-
-
-
Method Detail
-
globalInfo
public abstract String globalInfo()
Returns a string describing the cleaner.- Returns:
- a description suitable for displaying in the explorer/experimenter gui
-
reset
protected void reset()
Resets the cleaner.
Default implementation does nothing.
-
listOptions
public Enumeration<weka.core.Option> listOptions()
Returns an enumeration of all the available options..- Specified by:
listOptionsin interfaceweka.core.OptionHandler- Returns:
- an enumeration of all available options.
-
setOptions
public void setOptions(String[] options) throws Exception
Sets the OptionHandler's options using the given list. All options will be set (or reset) during this call (i.e. incremental setting of options is not possible).- Specified by:
setOptionsin interfaceweka.core.OptionHandler- Parameters:
options- the list of options as an array of strings- Throws:
Exception- if an option is not supported
-
getOptions
public String[] getOptions()
Gets the current option settings for the OptionHandler.- Specified by:
getOptionsin interfaceweka.core.OptionHandler- Returns:
- the list of current option settings as an array of strings
-
clean
public abstract String clean(String token)
Determines whether a token is clean or not.- Specified by:
cleanin interfaceTokenCleaner- Parameters:
token- the token to check- Returns:
- the clean token or null to ignore
-
-