|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.filters.Filter
weka.filters.SimpleFilter
weka.filters.SimpleStreamFilter
weka.filters.unsupervised.attribute.RenameAttribute
public class RenameAttribute
This filter is used for renaming attribute names.
Regular expressions can be used in the matching and replacing.
See Javadoc of java.util.regex.Pattern class for more information:
http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html
-find <regexp> The regular expression that the attribute names must match. (default: ([\s\S]+))
-replace <string> The string to replace the regular expression of matching attributes with. Cannot be used in conjunction with '-remove'. (default: $0)
-remove In case the matching string needs to be removed instead of replaced. Cannot be used in conjunction with '-replace <string>'. (default: off)
-all Replaces all occurrences instead of just the first. (default: only first occurrence)
-R <range> The attribute range to work on. This is a comma separated list of attribute indices, with "first" and "last" valid values. Specify an inclusive range with "-". E.g: "first-3,5,6-10,last". (default: first-last)
-V Inverts the attribute selection range. (default: off)
| Constructor Summary | |
|---|---|
RenameAttribute()
|
|
| Method Summary | |
|---|---|
String |
attributeIndicesTipText()
Returns the tip text for this property. |
String |
findTipText()
Returns the tip text for this property. |
String |
getAttributeIndices()
Gets the current range selection. |
Capabilities |
getCapabilities()
Returns the Capabilities of this filter. |
String |
getFind()
Returns the current regular expression for . |
boolean |
getInvertSelection()
Gets whether to invert the selection of the attributes. |
String[] |
getOptions()
Gets the current settings of the filter. |
String |
getReplace()
Returns the regular expression to replace matching attribute names with. |
boolean |
getReplaceAll()
Returns whether all occurrences are replaced or just the first one. |
String |
getRevision()
Returns the revision string. |
String |
globalInfo()
Returns a string describing this filter. |
String |
invertSelectionTipText()
Returns the tip text for this property. |
Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(String[] args)
Main method for executing this filter. |
String |
replaceAllTipText()
Returns the tip text for this property. |
String |
replaceTipText()
Returns the tip text for this property. |
void |
setAttributeIndices(String value)
Sets which attributes are to be acted on. |
void |
setFind(String value)
Sets the regular expression that the attribute names must match. |
void |
setInvertSelection(boolean value)
Sets whether to invert the selection of the attributes. |
void |
setOptions(String[] options)
Parses a given list of options. |
void |
setReplace(String value)
Sets the regular expression to replace matching attribute names with. |
void |
setReplaceAll(boolean value)
Sets whether to replace all occurrences or just the first one. |
| Methods inherited from class weka.filters.SimpleStreamFilter |
|---|
batchFinished, input |
| Methods inherited from class weka.filters.SimpleFilter |
|---|
debugTipText, getDebug, setDebug, setInputFormat |
| Methods inherited from class weka.filters.Filter |
|---|
batchFilterFile, filterFile, getCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, runFilter, toString, useFilter, wekaStaticWrapper |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RenameAttribute()
| Method Detail |
|---|
public String globalInfo()
globalInfo in class SimpleFilterpublic Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class SimpleFilter
public void setOptions(String[] options)
throws Exception
-find <regexp> The regular expression that the attribute names must match. (default: ([\s\S]+))
-replace <string> The string to replace the regular expression of matching attributes with. Cannot be used in conjunction with '-remove'. (default: $0)
-remove In case the matching string needs to be removed instead of replaced. Cannot be used in conjunction with '-replace <string>'. (default: off)
-all Replaces all occurrences instead of just the first. (default: only first occurrence)
-R <range> The attribute range to work on. This is a comma separated list of attribute indices, with "first" and "last" valid values. Specify an inclusive range with "-". E.g: "first-3,5,6-10,last". (default: first-last)
-V Inverts the attribute selection range. (default: off)
setOptions in interface OptionHandlersetOptions in class SimpleFilteroptions - the list of options as an array of strings
Exception - if an option is not supportedSimpleFilter.reset()public String[] getOptions()
getOptions in interface OptionHandlergetOptions in class SimpleFilterpublic void setFind(String value)
value - the regular expressionpublic String getFind()
public String findTipText()
public void setReplace(String value)
value - the regular expressionpublic String getReplace()
public String replaceTipText()
public void setReplaceAll(boolean value)
value - if true then all occurrences are replacepublic boolean getReplaceAll()
public String replaceAllTipText()
public void setAttributeIndices(String value)
value - a string representing the list of attributes. Since
the string will typically come from a user, attributes
are indexed from1. public String getAttributeIndices()
public String attributeIndicesTipText()
public void setInvertSelection(boolean value)
value - if true then the selection is invertedpublic boolean getInvertSelection()
public String invertSelectionTipText()
public Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class FilterCapabilitiespublic String getRevision()
getRevision in interface RevisionHandlergetRevision in class Filterpublic static void main(String[] args)
args - the arguments to the filter: use -h for help
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||